LLM API quickstart
Call RunAPI language models through a supported synchronous or streaming protocol.
RunAPI exposes language models through familiar public protocol shapes. Point an existing compatible client at https://runapi.ai, use a RunAPI model identifier, and authenticate with a standard API key.
Choose a protocol
- OpenAI-compatible Chat Completions uses
POST /v1/chat/completions. - OpenAI-compatible Responses uses
POST /v1/responses. - Anthropic-compatible Messages uses
POST /v1/messages. - Gemini-compatible content generation uses
/v1beta/models/{model}:generateContentor:streamGenerateContent.
Choose the protocol that best matches your existing client and application flow. The model catalog identifies which public protocols each model supports.
Send a request
This Chat Completions request returns one synchronous response:
curl "https://runapi.ai/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4",
"messages": [{"role": "user", "content": "Summarize why idempotency matters."}]
}'
Keep the request and response in the selected protocol shape. Use the operation’s API Reference for exact fields, tool calling, structured output, and model-specific constraints.
Stream output
Set the protocol’s streaming option and consume the returned server-sent events incrementally. For Chat Completions, add "stream": true; for Gemini-compatible calls, use the :streamGenerateContent operation. Close the stream when your client receives the protocol’s terminal event.
Handle errors and usage
Treat 401 as an authentication failure, 4xx responses as request or policy problems, and retry only transient server or network failures. Read token usage from the final response or terminal stream event in the selected protocol shape, and keep request identifiers in application logs for support.