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

# Welcome to LinkModel

> One API for 20+ image and video generation models. Save up to 30% versus official pricing.

## Quickstart

<Steps>
  <Step title="Get your API key">
    Sign in to your [Dashboard](https://linkmodel.ai/en/dashboard) and create an API key.
  </Step>

  <Step title="Pick a model">
    Browse the full <a href="https://linkmodel.ai/en/models" target="_blank" rel="noopener">model catalog</a> to compare capabilities and pricing — or jump straight into the [API Reference](/) on the left.
  </Step>

  <Step title="Send your first request">
    ```bash theme={null}
    curl --request POST \
      --url https://api.linkmodel.ai/api/v1/video-generation \
      --header 'Authorization: Bearer <YOUR_API_KEY>' \
      --header 'Content-Type: application/json' \
      --data '{
        "model": "sora-2",
        "prompt": "A golden retriever catching a frisbee in slow motion"
      }'
    ```

    The response includes a `task_id` — poll it to retrieve the generated asset.
  </Step>
</Steps>

## Base URL

```
https://api.linkmodel.ai/api/v1
```

All endpoints accept `application/json` and return JSON.

## Authentication

Pass your API key as a Bearer token in the `Authorization` header.

```bash theme={null}
Authorization: Bearer <YOUR_API_KEY>
```

Keys are managed in the [Dashboard](https://linkmodel.ai/en/dashboard). Treat them as secrets — never commit them to source control or expose them in client-side code.

## Response envelope

Every response shares the same outer shape:

| Field        | Type    | Description                                                        |
| ------------ | ------- | ------------------------------------------------------------------ |
| `code`       | integer | `0` indicates success; non-zero is an error (mirrors HTTP status). |
| `data`       | object  | Endpoint-specific payload. Empty `{}` on errors.                   |
| `msg`        | string  | Human-readable status or error message.                            |
| `request_id` | string  | Trace id — include when contacting support.                        |

### Success example

```json theme={null}
{
  "code": 0,
  "data": {
    "task_id": "cb6111cf-e89f-4978-b8e3-aa59c21cceff",
    "order_id": "019da9cf-d1db-78e1-ac23-526774d01193",
    "status": "processing",
    "price": 0.074
  },
  "msg": "success",
  "request_id": "250b66dd-e1fb-4bb6-b5f6-c668efadc35d"
}
```

## Error codes

| Code  | Meaning                                                            |
| ----- | ------------------------------------------------------------------ |
| `400` | Bad request — required field missing or invalid.                   |
| `401` | Unauthorized — missing or invalid API key.                         |
| `500` | Internal error — task creation failed (e.g. insufficient balance). |

All errors return the same envelope with a non-zero `code` and a descriptive `msg`.

## Next

Pick a model from the left sidebar to see its parameters, pricing, and try the endpoint live.
