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

# Text & embeddings

> Chat completions, text completions, and vector embeddings.

Text endpoints use the OpenAI-compatible format. Existing OpenAI SDK projects usually only need a new base URL, API key, and model ID.

## Recommended endpoints

| Use case                  | Method and path             | Main response fields         |
| ------------------------- | --------------------------- | ---------------------------- |
| Multi-turn chat and tools | `POST /v1/chat/completions` | `choices[].message`, `usage` |
| Legacy text completion    | `POST /v1/completions`      | `choices[].text`, `usage`    |
| Vector embeddings         | `POST /v1/embeddings`       | `data[].embedding`, `usage`  |

<Tip>
  Prefer chat completions for new conversational applications. Use text completions only when an existing client requires a plain prompt.
</Tip>

## Before you call

* Copy the exact model ID from the console.
* Set the OpenAI SDK base URL to `https://api.maxapi.ai/v1`.
* Match message roles and multimodal content to the selected model.
* Consume streaming responses incrementally instead of waiting for one JSON document.

<Card title="Run your first chat request" icon="rocket" href="/en/quickstart">
  Follow complete cURL, Python, and JavaScript examples.
</Card>
