curl --request POST \
--url https://api.bookie.app/v1/intents \
--header 'Authorization: Bearer bookie_live_abc123def456' \
--header 'Content-Type: application/json' \
--data '{
"walletAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"command": "Swap 5 SOL for USDC",
"slippage": 50
}'
const response = await fetch('https://api.bookie.app/v1/intents', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.BOOKIE_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
walletAddress: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',
command: 'Swap 5 SOL for USDC',
slippage: 50
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.bookie.app/v1/intents',
headers={
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
},
json={
'walletAddress': '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',
'command': 'Swap 5 SOL for USDC',
'slippage': 50
}
)
{
"intentId": "intent_abc123def456",
"action": "swap",
"parameters": {
"inputToken": "So11111111111111111111111111111111111111112",
"outputToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": 5000000000
},
"route": {
"inAmount": "5000000000",
"outAmount": "736250000",
"priceImpact": 0.12,
"marketInfos": [
{
"id": "orca",
"label": "Orca Whirlpool",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "5000000000",
"outAmount": "736250000",
"fee": 0.003
}
]
},
"confidence": 0.98
}
{
"error": {
"code": "validation_error",
"message": "Invalid wallet address format",
"field": "walletAddress"
}
}
{
"error": {
"code": "parsing_error",
"message": "Could not extract transaction parameters from command",
"details": {
"command": "Do something",
"reason": "Ambiguous intent - please specify tokens and amounts"
}
}
}
Intent Operations
Parse Intent
Parse natural language command into transaction parameters
POST
/
v1
/
intents
curl --request POST \
--url https://api.bookie.app/v1/intents \
--header 'Authorization: Bearer bookie_live_abc123def456' \
--header 'Content-Type: application/json' \
--data '{
"walletAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"command": "Swap 5 SOL for USDC",
"slippage": 50
}'
const response = await fetch('https://api.bookie.app/v1/intents', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.BOOKIE_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
walletAddress: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',
command: 'Swap 5 SOL for USDC',
slippage: 50
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.bookie.app/v1/intents',
headers={
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
},
json={
'walletAddress': '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',
'command': 'Swap 5 SOL for USDC',
'slippage': 50
}
)
{
"intentId": "intent_abc123def456",
"action": "swap",
"parameters": {
"inputToken": "So11111111111111111111111111111111111111112",
"outputToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": 5000000000
},
"route": {
"inAmount": "5000000000",
"outAmount": "736250000",
"priceImpact": 0.12,
"marketInfos": [
{
"id": "orca",
"label": "Orca Whirlpool",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "5000000000",
"outAmount": "736250000",
"fee": 0.003
}
]
},
"confidence": 0.98
}
{
"error": {
"code": "validation_error",
"message": "Invalid wallet address format",
"field": "walletAddress"
}
}
{
"error": {
"code": "parsing_error",
"message": "Could not extract transaction parameters from command",
"details": {
"command": "Do something",
"reason": "Ambiguous intent - please specify tokens and amounts"
}
}
}
Authorization
string
required
Bearer token. Format:
Bearer bookie_live_abc123def456Body Parameters
string
required
Solana wallet address. Format: Base58 encoded public key
string
required
Natural language command. Max 500 characters.Examples: “Swap 5 SOL for USDC”, “Send 10 USDC to alice.sol”
number
Slippage tolerance in basis points. Default: 50 (0.5%)Range: 1-1000 (0.01% - 10%)
number
Priority fee in microlamports. Default: 1000Higher values increase transaction priority during congestion
Response
string
Unique intent identifier. Format:
intent_<16 chars>string
Parsed action type. Options:
swap, transfer, queryobject
Extracted transaction parametersProperties:
inputToken(string): Input token mint addressoutputToken(string): Output token mint addressamount(number): Amount in base units (lamports)recipient(string): Recipient address (for transfers)
object
Jupiter routing information (for swaps)Properties:
inAmount(string): Input amountoutAmount(string): Expected output amountpriceImpact(number): Price impact percentagemarketInfos(array): DEX routing details
number
Intent parsing confidence score (0-1)
curl --request POST \
--url https://api.bookie.app/v1/intents \
--header 'Authorization: Bearer bookie_live_abc123def456' \
--header 'Content-Type: application/json' \
--data '{
"walletAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"command": "Swap 5 SOL for USDC",
"slippage": 50
}'
const response = await fetch('https://api.bookie.app/v1/intents', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.BOOKIE_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
walletAddress: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',
command: 'Swap 5 SOL for USDC',
slippage: 50
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.bookie.app/v1/intents',
headers={
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
},
json={
'walletAddress': '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',
'command': 'Swap 5 SOL for USDC',
'slippage': 50
}
)
{
"intentId": "intent_abc123def456",
"action": "swap",
"parameters": {
"inputToken": "So11111111111111111111111111111111111111112",
"outputToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": 5000000000
},
"route": {
"inAmount": "5000000000",
"outAmount": "736250000",
"priceImpact": 0.12,
"marketInfos": [
{
"id": "orca",
"label": "Orca Whirlpool",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "5000000000",
"outAmount": "736250000",
"fee": 0.003
}
]
},
"confidence": 0.98
}
{
"error": {
"code": "validation_error",
"message": "Invalid wallet address format",
"field": "walletAddress"
}
}
{
"error": {
"code": "parsing_error",
"message": "Could not extract transaction parameters from command",
"details": {
"command": "Do something",
"reason": "Ambiguous intent - please specify tokens and amounts"
}
}
}