# API overview

The Airframe API runs your graphics from anywhere: a Stream Deck through Companion, a script, a scoreboard feed or your own app.

## How it's shaped

Each **output** plays one **composition**, at a **version** you choose. The API has two kinds of call:

- **Resources** you read and change: an output's state, its composition and the instances prepared for it. These are ordinary REST endpoints.
- **Commands** that act on an output: put a component on air, take it off, change its data, play an event or run a timer. You send them in a batch to [Run commands](https://docs.airframe.tv/api/run-commands), or over the [control WebSocket](https://docs.airframe.tv/api/websocket).

```json
{
  "commands": [
    { "command": "update", "scope": "root", "data": { "homeScore": 3 } },
    { "command": "in", "component": "score-bug" }
  ]
}
```

## Base URL

Every endpoint lives under `/v1` on the API's host, for example `https://api.airframe.tv/v1`. Requests and responses are JSON.

## Ids and keys

Commands name components, layers, events, timers and instances by **id**. Data is named by each field's **key**, such as `homeScore`.

You'll find ids in the editor: select a layer or component and its ID is at the top of the properties panel, with a copy button. Ids are yours to change, so give the ones you'll script against readable names like `lower-third` before you publish.

## Authentication

Send a workspace API key as a bearer token. Keys are made by owners and admins in **Organisation settings › API keys**, and each one controls every output or just the ones you choose. See [Authentication](https://docs.airframe.tv/api/authentication).

```sh
curl https://api.airframe.tv/v1/outputs/OUTPUT_ID/state \
  -H "Authorization: Bearer $AIRFRAME_KEY"
```

## OpenAPI

The API describes itself with OpenAPI 3.1 at `/v1/openapi.json`, which you can feed to a client generator, and you can try requests in the browser at `/v1/docs`.

## For AI tools

Building an integration with an AI assistant? Give it the docs as Markdown:

- [`/llms.txt`](https://docs.airframe.tv/llms.txt) indexes every page, following [llmstxt.org](https://llmstxt.org).
- [`/llms-full.txt`](https://docs.airframe.tv/llms-full.txt) is every page in one file, API reference first.
- **Copy page** at the top of any page copies it as Markdown, examples included.
