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

# Introduction

> Base URL, authentication, request format, and error handling for the Upmore API.

## Base URL

All API requests are made to the following base URL:

```
https://api.upmore.net
```

## Authentication

Upmore uses Bearer token authentication. Include your API key in the `Authorization` header of every request:

```
Authorization: Bearer YOUR_API_KEY
```

You can generate and manage API keys in the [API Keys](https://api.upmore.net/keys).

<Warning>
  Keep your API key secure. Do not expose it in client-side code or public repositories.
</Warning>

## Request format

All requests must use `Content-Type: application/json`. Request bodies are JSON-encoded.

```bash theme={null}
curl https://api.upmore.net/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'
```

## Supported endpoints

| Endpoint                         | Description                           |
| -------------------------------- | ------------------------------------- |
| `POST /v1/chat/completions`      | Chat completion (OpenAI-compatible)   |
| `POST /v1/images/generations`    | Image generation (ByteDance Seedream) |
| `POST /v1/images/edits`          | Image editing (reference image)       |
| `POST /v1/video/generations`     | Video generation (ByteDance Seedance) |
| `GET /v1/video/generations/{id}` | Query video generation task status    |

## Response format

All responses are JSON-encoded. A successful response typically includes:

```json theme={null}
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "model": "gpt-5.5",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 12,
    "total_tokens": 22
  }
}
```

## Error handling

When an error occurs, the API returns a JSON response with an `error` object:

```json theme={null}
{
  "error": {
    "message": "Invalid API key provided.",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}
```

### HTTP status codes

| Status | Description                               |
| ------ | ----------------------------------------- |
| `200`  | Success                                   |
| `400`  | Bad request — invalid parameters          |
| `401`  | Unauthorized — invalid or missing API key |
| `403`  | Forbidden — insufficient permissions      |
| `404`  | Not found — invalid endpoint              |
| `429`  | Rate limit exceeded — too many requests   |
| `500`  | Internal server error                     |

## Rate limits

Rate limits vary by model and subscription tier. If you hit a rate limit, the API returns a `429` status code. Implement exponential backoff to handle rate limiting gracefully.

## OpenAI SDK compatibility

Upmore is compatible with the OpenAI SDK. Simply change the `base_url` to use Upmore:

<CodeGroup>
  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(
      api_key="YOUR_API_KEY",
      base_url="https://api.upmore.net/v1"
  )
  ```

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

  const client = new OpenAI({
    apiKey: "YOUR_API_KEY",
    baseURL: "https://api.upmore.net/v1",
  });
  ```
</CodeGroup>
