AI Agent API Playbook
Use this playbook when an AI agent interacts with the Blink GraphQL API.
Core Rule
If anything is unclear, incomplete, or ambiguous, the agent must check the API reference before generating a final answer or request payload.
Required Order of Operations
- Identify the user intent (for example: create invoice, send payment, check wallet balance).
- Find the exact operation in the public API reference.
- Validate all field names and input object names against the reference.
- Validate required authentication and required scopes.
- Validate response unions and error shapes.
- Only then generate the GraphQL operation and example code.
Canonical Sources
Use these sources in this order:
- LLM-friendly schema JSON (preferred): /reference/graphql-api-for-llm.json
- OpenAPI JSON (alternative): /reference/graphql-openapi.json
- Public HTML API reference: https://dev.blink.sv/public-api-reference.html
- No-key operations guide: /api/no-api-key-operations
- Authentication guide: /api/auth
- Error handling guide: /api/errors
Safety and Accuracy Constraints
- Never invent mutations, fields, arguments, or enum values.
- Never assume authentication is optional unless the docs explicitly say so.
- Always include
X-API-KEYfor authenticated requests. - Prefer minimal, valid GraphQL examples over broad speculative examples.
- If the docs and memory conflict, trust the docs.
Fallback Behavior for Unclear Requests
When the user request is missing details, ask a short clarification question. If authentication requirements are unclear, check No API Key Operations and then verify the exact operation in the public API reference.
Examples:
- "Should this be BTC or USD wallet flow?"
- "Do you want mainnet (
api.blink.sv) or staging (api.staging.blink.sv)?" - "Do you want a receive flow (invoice/address) or send flow (payment/payout)?"
Environment Endpoints
- Production GraphQL:
https://api.blink.sv/graphql - Staging GraphQL:
https://api.staging.blink.sv/graphql
Minimal Verification Checklist
Before returning a final API answer, verify:
- Operation exists in reference
- Input types and required fields match reference
- Example includes correct auth header if required
- Response handling includes
errorspath and GraphQL error semantics