Redeo Docs
DocsAPI Reference / Chat Completions

Direct Model Access

Chat Completions

Direct LLM access with automatic provider fallback.

Overview

POST /v1/chat/completions sends a prompt directly to an LLM using your connected provider API keys. This is the simplest way to use Redeo as a drop-in replacement for OpenAI — same request shape, same response shape.

Redeo routes your request through the provider connections you've configured (OpenAI, Anthropic, DeepInfra, etc.) with automatic fallback if a provider fails.

Request Body

FieldTypeRequiredDescription
modelstringYesModel to use (e.g. gpt-4o, claude-sonnet-4-20250514, deepseek-r1). Must be supported by one of your configured providers.
messagesarrayYesArray of message objects with role (system, user, assistant) and content (string or content parts). The last user message is used as the prompt.
temperaturenumberNoSampling temperature. Passed through to the provider.
max_tokensintegerNoMaximum tokens to generate. Passed through to the provider.
streambooleanNoNot yet supported. Must be omitted or false.

Response Shape

The response is a standard OpenAI chat completion object:

json
{
  "id": "redeo-chat-<uuid>",
  "object": "chat.completion",
  "created": 1716234567,
  "model": "gpt-4o",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The generated response..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 42,
    "completion_tokens": 128,
    "total_tokens": 170
  }
}

Example

bash
curl https://api.redeo.ai/v1/chat/completions \
  -H "Authorization: Bearer $REDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

This uses your highest-priority provider connection that supports gpt-4o. If that provider fails, Redeo falls back to the next available provider automatically.