> ## 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.

# Choose an API format

> Choose a MaxAPI endpoint by client, model capability, and task type.

MaxAPI provides OpenAI-compatible endpoints and provider-native formats. They use the same account system, but their paths, request fields, and response shapes can differ.

## Quick selection

| Your requirement                                     | Recommended format                | Common paths                                   | Result delivery               |
| ---------------------------------------------------- | --------------------------------- | ---------------------------------------------- | ----------------------------- |
| Migrate an OpenAI application                        | OpenAI-compatible                 | `/v1/chat/completions`, `/v1/embeddings`       | Usually synchronous           |
| Generate images or process audio                     | OpenAI-compatible                 | `/v1/images/generations`, `/v1/audio/*`        | Defined by the endpoint       |
| Use advanced model parameters                        | Provider-native                   | `/aistudio/*`, `/wan/*`, `/kling/*`, `/vidu/*` | Preserves provider structures |
| Generate video, music, or other long-running content | Paired create and query endpoints | Follow the model's endpoint pages              | Returns a task ID to poll     |

<Tip>
  If both formats support your use case, choose the one your client already supports. This reduces request and response conversion code.
</Tip>

## Confirm the base URL

The OpenAI SDK `base_url` normally includes `/v1`:

```text theme={null}
https://api.maxapi.ai/v1
```

For a direct HTTP request, use the complete path shown on the endpoint page:

```text theme={null}
https://api.maxapi.ai/v1/chat/completions
```

<Warning>
  Do not automatically add `/v1` to provider-native paths. Append paths such as `/wan/*`, `/kling/*`, and `/vidu/*` directly to `https://api.maxapi.ai`.
</Warning>

## Choose in this order

<Steps>
  <Step title="Confirm the client protocol">
    Check whether your SDK or application supports OpenAI, Google, or a provider-native format. An existing OpenAI client usually requires only a different base URL, API key, and model ID.
  </Step>

  <Step title="Confirm the model capability">
    Copy the model ID from the MaxAPI console. Confirm that the model supports the text, image, video, audio, or music capability you need.
  </Step>

  <Step title="Confirm how results are delivered">
    A synchronous endpoint returns its result in the current response. An asynchronous endpoint returns a task ID that you use with a matching query endpoint.
  </Step>

  <Step title="Check the endpoint schema">
    Open the endpoint page and verify its authentication header, content type, required fields, and response example. Do not reuse request bodies across providers without adapting them.
  </Step>
</Steps>

## Keep request formats separate

The same capability can have several API formats. For example, video APIs may use `id`, `task_id`, or `taskId` for a task identifier and may define different status values.

* Read the task ID field returned by the create endpoint.
* Use the query endpoint from the same API family.
* Interpret success and failure states according to that query endpoint.
* Download generated assets promptly because their URLs may expire.

<CardGroup cols={2}>
  <Card title="Send your first request" icon="rocket" href="/en/quickstart">
    Complete a chat request with the OpenAI-compatible format.
  </Card>

  <Card title="Handle asynchronous tasks" icon="clock" href="/en/guides/async-tasks">
    Add polling, timeouts, and retries.
  </Card>
</CardGroup>
