Overview

AFK Crypto provides a simple, secure, non-custodial API for wallet automation across EVM and Solana.

Headers

HeaderValueRequiredNotes
x-api-keyafk_<prefix>_<random>Authenticate every request
Idempotency-KeyUUID✓ writesEnsures single submission per key
Content-Typeapplication/json✓ when bodyJSON requests only
x-request-idstringReturned on every response
Base path
string
https://app.afkcrypto.com/api/v1
Auth
header
x-api-key: afk_<prefix>_<random>
Idempotency
header
Idempotency-Key: <uuid> required for write endpoints. Repeats return the identical response.
Content-Type
header
Content-Type: application/json required for all JSON requests
Response headers
header
All responses include x-request-id for support/debugging
Errors
object
{ error: string, code?: string, requestId?: string }

Error codes

  • RATE_LIMITED, INVALID_INPUT, WALLET_NOT_FOUND, USER_NOT_LINKED, WALLET_NOT_DELEGATED, WALLET_ID_REQUIRED, CHAIN_UNKNOWN, IDEMPOTENT_BODY_MISMATCH, IDEMPOTENT_REPLAY, PRIVY_RPC_ERROR, SEND_FAILED, SERVICE_UNAVAILABLE, QUOTE_FAILED

Implemented endpoints

Planned

  • POST /webhooks (Privy tx events)

Rate limiting

  • 10 requests per minute per API key
  • HTTP 429 with Retry-After header when exceeded

Error examples

HTTP/1.1 401 Unauthorized
x-request-id: req_123
Content-Type: application/json

{"error":"missing or invalid api key","requestId":"req_123"}

Validations

  • EVM address: must match /^0x[a-fA-F0-9]{40}$/
  • Solana address: must be a valid base58 public key
  • simulate: accepted but currently returns “not supported yet”

Trades

  • Quotes: EVM via 1inch v6; Solana via 1inch when configured.
  • Swaps: EVM and Solana are supported. For Solana, supply a base64-encoded transaction for execution.

OpenAPI

These pages are auto-generated from the OpenAPI file.

AFK API v1 OpenAPI

View the OpenAPI specification

Tools

You can import the OpenAPI file into Postman/Insomnia to try requests quickly. A Postman collection will be provided soon.