Authentication
- Header:
X-PAYMENT: <base64 signed USDC> - No api key, no account, no onboarding — wallet is taken from the signed payment.
- Used by
POST /v1/chat/completions,/v1/auth/agent-onboard, and/v1/credits/purchase.
X-PAYMENT: <base64 signed USDC>POST /v1/chat/completions, /v1/auth/agent-onboard, and /v1/credits/purchase.400 — unsupported combo (e.g. stream:true on x402)401 — invalid or missing auth402 — payment required or credits exhausted403 — wallet mismatch409 — idempotency conflict422 — request body validationThe one endpoint most agents need. Per-token billing — pay-per-call with x402, or use an API key that debits credits from a pre-funded balance.
/v1/chat/completionsOpenAI-style LLM completions with optional wallet-scoped vector memory. Pay per call via X-PAYMENT (x402 USDC) or x-api-key (debits credits).
messagesarrayrequiredChat messages.
modelenumGemini model: gemini-2.5-flash (default), gemini-2.5-flash-lite (cheapest), gemini-2.5-pro (most capable), gemini-3.1-flash-lite (newer Lite, better reasoning), or gemini-3.5-flash (newest Pro-tier reasoner). Per-token rate varies by model — see the rate sheet on the home page.
memory_readbooleanRetrieve memory context. Default true.
memory_writebooleanStore user/assistant memory. Default true.
memory_write_modeenumauto|raw|summary for memory writes. Default auto.
memory_max_charsintegerMax chars stored per memory write artifact. Default 1200.
kintegerTop-k memories.
temperaturenumberGeneration temperature.
streambooleanEmit OpenAI-compatible SSE chunks instead of a single JSON response. Default false. Only valid on the api-key path; x402 requests with stream:true return 400.
curl -X POST https://api.vectorway.io/v1/chat/completions \
-H "X-PAYMENT: <base64 signed USDC payment>" \
-H "Content-Type: application/json" \
-d '{
"messages":[{"role":"user","content":"Summarize our last run"}],
"model":"gemini-2.5-flash",
"memory_read":true,
"memory_write":true,
"memory_write_mode":"auto",
"memory_max_chars":1200,
"k":5,
"temperature":0.3,
"stream":false
}'
Wallet authentication and JWT session lifecycle for agent-first accounts.
/v1/auth/agent-onboardVerifies x402 payment, creates account if needed, grants credits, issues a JWT, and returns a new API key.
wallet_addressstringrequiredWallet to onboard and credit.
creditsintegerrequiredCredits to add. Min 500,000 (≈$0.50 floor), max 1,000,000,000 (≈$1000 ceiling). 1 credit = 1 atomic USDC = $0.000001 → linear $1 → 1,000,000 credits.
key_namestringOptional API key display name.
curl -X POST https://api.vectorway.io/v1/auth/agent-onboard \
-H "X-PAYMENT: <base64 signed USDC payment>" \
-H "Content-Type: application/json" \
-d '{
"wallet_address":"0xabc...",
"credits":5000000,
"key_name":"agent-prod"
}'
/v1/auth/siwe/challengeCreates nonce-backed SIWE message for a wallet.
wallet_addressstringrequiredWallet address for challenge issuance.
chain_idintegerEVM chain ID. Default 1.
curl -X POST https://api.vectorway.io/v1/auth/siwe/challenge \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "0xabc...",
"chain_id": 1
}'
/v1/auth/siwe/verifyVerifies signature + nonce, creates/loads an agent-first account, and returns access + refresh JWTs.
wallet_addressstringrequiredWallet being authenticated.
messagestringrequiredSIWE message returned by challenge.
signaturestringrequiredWallet signature over SIWE message.
curl -X POST https://api.vectorway.io/v1/auth/siwe/verify \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "0xabc...",
"message": "localhost wants you to sign in...",
"signature": "0x..."
}'
/v1/auth/refreshConsumes current refresh token and returns a new access+refresh pair.
refresh_tokenstringrequiredCurrent refresh JWT.
curl -X POST https://api.vectorway.io/v1/auth/refresh \
-H "Content-Type: application/json" \
-d '{"refresh_token":"eyJ..."}'
/v1/auth/revokeInvalidates provided refresh token (logout).
refresh_tokenstringrequiredRefresh JWT to revoke.
curl -X POST https://api.vectorway.io/v1/auth/revoke \
-H "Content-Type: application/json" \
-d '{"refresh_token":"eyJ..."}'
Wallet account state, compatibility aliases, and API call history.
/v1/meJWT-gated account profile for the authenticated wallet.
curl https://api.vectorway.io/v1/me \
-H "Authorization: Bearer <ACCESS_JWT>"
/v1/usageWallet-scoped call history (newest first).
limitintegerEvents per page. 1–100, default 50.
cursorintegerOpaque list offset from a previous response's next_cursor. Omit for the first page.
filterstringEither "all" (default), "errors" (status ≥ 400), or an exact request path (e.g. "/v1/chat/completions") for path-scoped reads.
curl https://api.vectorway.io/v1/usage?limit=50&cursor=0&filter=all \
-H "Authorization: Bearer <ACCESS_JWT>"
Top-ups, Stripe checkout, balance, and the credit-movement ledger.
/v1/credits/purchasex402 payment proof endpoint. Wallet must already have an account and match the wallet in the payment proof.
wallet_addressstringrequiredWallet to credit.
creditsintegerrequiredCredits to add (1 credit = 1 atomic USDC = $0.000001). Min 500,000 (≈$0.50), max 1,000,000,000 (≈$1000).
curl -X POST https://api.vectorway.io/v1/credits/purchase \
-H "X-PAYMENT: <base64 signed USDC payment>" \
-H "Content-Type: application/json" \
-d '{"wallet_address":"0xabc...","credits":5000000}'
/v1/credits/meWorks with JWT bearer (control plane) or API key (runtime). `credits` is the wallet's current credit balance (1 credit = $0.000001).
curl https://api.vectorway.io/v1/credits/me \
-H "Authorization: Bearer <ACCESS_JWT>"
/v1/credits/ledgerWallet-scoped credit ledger (newest first) covering top-ups, refunds, and grants.
limitintegerEvents per page. 1–100, default 50.
cursorintegerOpaque list offset from a previous response's next_cursor.
kindstringOptional filter: "topup" | "debit" | "refund" | "grant". Omit to return every kind. Case-insensitive.
curl https://api.vectorway.io/v1/credits/ledger?limit=50&cursor=0&kind=topup \
-H "Authorization: Bearer <ACCESS_JWT>"
API key creation, listing, and revocation.
/v1/api-keysJWT control-plane endpoint. Returns raw key once.
wallet_addressstringrequiredWallet owner of key.
key_namestringrequiredDisplay name for key.
curl -X POST https://api.vectorway.io/v1/api-keys \
-H "Authorization: Bearer <ACCESS_JWT>" \
-H "Content-Type: application/json" \
-d '{"wallet_address":"0xabc...","key_name":"my-agent"}'
/v1/api-keysReturns API key metadata for wallet.
curl https://api.vectorway.io/v1/api-keys \
-H "Authorization: Bearer <ACCESS_JWT>"
/v1/api-keys/{key_id}Deletes selected key if it belongs to wallet.
key_idpath stringrequiredAPI key identifier.
wallet_addressstringrequiredWallet owner.
curl -X DELETE https://api.vectorway.io/v1/api-keys/{key_id} \
-H "Authorization: Bearer <ACCESS_JWT>" \
-H "Content-Type: application/json" \
-d '{"wallet_address":"0xabc..."}'
Read-only introspection over the wallet-scoped vector index. Memory is populated by the chat endpoint when memory_write=true.
/v1/memorySemantic search over wallet-scoped memory index. Memory itself is populated by the chat endpoint when memory_write=true; this endpoint is read-only introspection.
qstringrequiredSemantic query text.
kintegerResult count. Default 5.
curl https://api.vectorway.io/v1/memory?q=last+simulation&k=5 \
-H "x-api-key: <API_KEY>"
/v1/memory/{memory_id}Deletes a wallet-scoped memory record by id. Use the id returned by a memory-search match.
memory_idpath stringrequiredMemory identifier returned by GET /v1/memory.
curl -X DELETE https://api.vectorway.io/v1/memory/{memory_id} \
-H "x-api-key: <API_KEY>" \
-H "Content-Type: application/json" \
-d '# no body'