Developer API
Ricochet Code API
Ricochet coding automation включает hosted model gateway, budget checks, usage reporting, premium approvals и Cloud Bridge для remote IDE control.
#Budget and usage
Проверяйте ricochet_code credits, отправляйте usage и запрашивайте premium approval decisions.
МетодEndpointОписание
GET
/ricochet/budgetПроверяет ricochet_code credits, plan, window limits, task limits и upgrade URL перед hosted AI run.
POST
/ricochet/usage/reportОтправляет hosted model usage с idempotency, token counts, provider, model и billing metadata.
POST
/ricochet/usage/approve-premiumСохраняет temporary approval для premium model usage в task, run или session.
#Hosted model gateway
Используйте этот Ricochet-specific chat completions endpoint для hosted coding automation со streaming support.
Пример
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
}'МетодEndpointОписание
POST
/ricochet/openai/v1/chat/completionsЗапускает Ricochet hosted coding models через OpenAI-compatible chat completions gateway с streaming support.