Quickstart
API calls
A complete call has five steps. Steps 2 and 3 are free; only execution reserves and charges credits.
- Create a connection key and authorize a source.
- Discover sources with
GET /api/v1/capabilities/credits.estimate/targets; add?capability_key=image.generateor?capability_key=video.generateto have the server return only that capability's sources. - Optionally estimate the cost with
POST /api/v1/capabilities/credits.estimate/estimates. - Quote the exact request, then submit it.
- Poll your own task and read the result.
BASH
curl -s https://api.anycap.io/v1/chat/completions \ -H "Authorization: Bearer $ANYCAP_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $OPERATION_ID" \ -H "X-Anycap-Source: $SOURCE_ID" \ -d '{"model":"<model>","messages":[{"role":"user","content":"Say hello in one sentence."}],"max_tokens":32,"stream":false}'PreviousAuthentication
NextCoding agents