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

# API Reference

> Complete reference for the ShuttleAI REST API.

The ShuttleAI API is fully **OpenAI-compatible**. If your code works with OpenAI, it works with ShuttleAI — just change the base URL and API key.

## Base URL

```
https://api.shuttleai.com/v1
```

## Authentication

All requests require a Bearer token in the `Authorization` header:

```
Authorization: Bearer shuttle-xxx
```

Get your API key from the [Dashboard](https://shuttleai.com/keys).

## SDKs

ShuttleAI works with any OpenAI-compatible SDK:

<CodeGroup>
  ```python Python (OpenAI SDK) theme={null}
  pip install openai
  ```

  ```bash Node.js (OpenAI SDK) theme={null}
  npm install openai
  ```
</CodeGroup>

### Python

```python theme={null}
from openai import OpenAI

client = OpenAI(
    api_key="shuttle-xxx",
    base_url="https://api.shuttleai.com/v1"
)
```

### Node.js

```javascript theme={null}
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "shuttle-xxx",
  baseURL: "https://api.shuttleai.com/v1",
});
```

## Available endpoints

| Endpoint               | Method | Description                      |
| ---------------------- | ------ | -------------------------------- |
| `/v1/chat/completions` | POST   | Generate text completions        |
| `/v1/models`           | GET    | List all available models        |
| `/v1/models/{id}`      | GET    | Get details for a specific model |

## Response format

All endpoints return JSON. Successful responses use standard HTTP 200. Errors return the appropriate HTTP status code with an error object:

```json theme={null}
{
  "error": {
    "message": "Error description",
    "type": "error_type",
    "code": 400
  }
}
```

See [Error Codes](/guides/error-codes) for a complete reference.

## Rate limits

Rate limits depend on your [plan](/pricing/plans):

| Plan    | Requests/minute |
| ------- | --------------- |
| Free    | 2               |
| Basic   | 10              |
| Premium | 30              |
| Scale   | 80              |

Some models have [multipliers](/pricing/multipliers) that consume more than 1 request per call.
