Chat completions

POST /v1/chat/completions

POST/v1/chat/completions

The standard OpenAI Chat Completions API. Any model in the catalog can be used, regardless of vendor.

bash
curl https://provider.texhub.ai/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6-astra",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Explain recursion in one sentence."}
    ],
    "temperature": 0.7,
    "max_tokens": 200
  }'

Supported parameters

messages, temperature, top_p, max_tokens / max_completion_tokens, stop, stream, tools, tool_choice, response_format, reasoning_effort, seed and image inputs (image_url content parts) are forwarded when the selected model supports them. Unsupported parameters are handled the way the underlying provider handles them.

Usage

Responses include a usage object (prompt, completion and, where available, cached and reasoning tokens). With stream: true, usage is always collected on our side for billing; pass stream_options: {"include_usage": true} to receive it in the final chunk.

Models from Anthropic or Google also work on this endpoint; we translate the request automatically.