Developer API
Ricochet Code API
Ricochet coding automation has a hosted model gateway, budget checks, usage reporting, premium approvals, and a Cloud Bridge for remote IDE control.
#Budget and usage
Check available ricochet_code credits, report usage, and request premium approval decisions.
MethodEndpointDescription
GET
/ricochet/budgetCheck ricochet_code credits, plan, window limits, task limits, and upgrade URL before a hosted AI run.
POST
/ricochet/usage/reportReport hosted model usage with idempotency, token counts, provider, model, and billing metadata.
POST
/ricochet/usage/approve-premiumStore a temporary approval for premium model usage in a task, run, or session.
#Hosted model gateway
Use this Ricochet-specific chat completions endpoint for hosted coding automation with streaming support.
Example
curl "https://grik.io/api/v1/ricochet/budget?task_id=run_123" \
-H "Authorization: Bearer GRIK_API_KEY"
curl -X POST https://grik.io/api/v1/ricochet/openai/v1/chat/completions \
-H "Authorization: Bearer GRIK_API_KEY" \
-H "Idempotency-Key: run_123_turn_1" \
-H "Content-Type: application/json" \
-d '{
"model": "ricochet-code",
"messages": [
{"role": "user", "content": "Review this repository and suggest the first safe fix."}
],
"stream": true
}'MethodEndpointDescription
POST
/ricochet/openai/v1/chat/completionsRun Ricochet hosted coding models through an OpenAI-compatible chat completions gateway with streaming support.