Подключение cURL
cURL is the smallest tool for verifying whether RouteAPI is available. Run cURL first for every integration, then connect an SDK.
Chat Completions
Section titled “Chat Completions”curl https://www.routeapi.ai/v1/chat/completions \ -H "Authorization: Bearer $ROUTEAPI_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o", "messages": [ { "role": "user", "content": "Hello RouteAPI" } ] }'Потоковый вывод
Section titled “Потоковый вывод”curl https://www.routeapi.ai/v1/chat/completions \ -H "Authorization: Bearer $ROUTEAPI_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o", "stream": true, "messages": [ { "role": "user", "content": "Опиши RouteAPI в трех пунктах" } ] }'Советы по диагностике
Section titled “Советы по диагностике”- 401: check the Token.
- 402: check the balance.
- 429: reduce request frequency.
- 502/503: check model service status or retry later.