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

# Create Chat Completion

> Send OpenAI-compatible chat requests to VoidAI, including streaming, tool calls, and model-supported multimodal inputs.

`POST https://api.voidai.app/v1/chat/completions`

Requires [authentication](https://docs.voidai.app/authentication.md). Choose a model that advertises `/v1/chat/completions`; access also depends on your account and balance.

## Request

| Field | Type | Description |
| - | - | - |
| `model` | string, required | Exact model ID from the [catalog](https://docs.voidai.app/api-reference/models/list.md). |
| `messages` | array, required | Conversation messages. Roles include `system`, `developer`, `user`, `assistant`, `tool`, and `function`. |
| `stream` | boolean | Return server-sent events when supported. |
| `stream_options.include_usage` | boolean | Request usage in the stream. |
| `max_tokens` / `max_completion_tokens` | number | Positive output-token limit; support depends on the model. |
| `temperature` | number | Sampling parameter; support depends on the model. |
| `tools`, `tool_choice` | array / string or object | Tool definitions and selection for models that support them. |
| `response_format` | object | `type` is `text` or `json_object`, subject to model support. |
| `reasoning_effort` | string | `off`, `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`, where supported. |

Message content can be text or content parts such as `text` and `image_url`. Tool-call messages can include `tool_calls` or `tool_call_id`. Optional parameters are not universal provider features.

```bash theme={null}
curl https://api.voidai.app/v1/chat/completions \
  -H "Authorization: Bearer $VOIDAI_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}'
```

## Response

Non-streaming responses use the OpenAI chat-completion shape: `id`, `object`, `model`, `choices`, and `usage`. Read text from `choices[0].message.content`; a tool response can instead provide `tool_calls`. Streaming responses use SSE chunks with `choices[].delta`; consumers must handle empty choices in usage chunks.

See [SDK examples](https://docs.voidai.app/guides/openai-sdk.md), [billing](https://docs.voidai.app/guides/credits.md), and [error handling](https://docs.voidai.app/guides/errors.md). Claude-family routing limitations are documented on the [Messages page](https://docs.voidai.app/api-reference/messages/create.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.