> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inworld.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat Completions (Text)

> Standard text-to-text workflows with Inworld Router

The `/v1/chat/completions` endpoint is the primary interface for text-based workflows. It supports streaming, tool calling, and structured outputs across all providers.

## Standard Request

```bash theme={"system"}
curl --request POST \
  --url https://api.inworld.ai/v1/chat/completions \
  --header 'Authorization: Bearer <your-api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "auto",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Write a 50-word bio for a software engineer."}
    ],
    "stream": true
  }'
```

## Advanced Features

### Tool Calling (Function Calling)

Inworld Router normalizes tool calling. You define tools in the OpenAI format, and the router translates them for Anthropic or Google models.

### Structured Outputs (JSON Mode)

Force the model to return valid JSON by setting `response_format: { "type": "json_object" }`. Inworld Router ensures the underlying provider respects this constraint.

### Streaming

Real-time token streaming is supported for all providers. The stream format is identical to OpenAI's Server-Sent Events (SSE).

### Web search

See [Web search](/router/capabilities/web-search) for `extra_body.web_search`, `web_search_options`, and citation annotations.
