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

# Overview

> What the QX API covers, how to get your key, and how to send your first request.

The QX API lets your own code use what you build in QX: send messages to [agents](https://docs.qxlabs.com/agents/overview.md), execute [flows](https://docs.qxlabs.com/flows/overview.md) and [grids](https://docs.qxlabs.com/grids/overview.md), and read their results. Every call runs as you, inside your org, and uses your org's [credits](https://docs.qxlabs.com/getting-started/plans-and-credits.md) the way the app does.

## Get your key

In the app, open Settings → [**API Access**](https://app.qxlabs.com/settings/api-access) and request the products you need.

![The API Access page in Settings, with the products to request and a box for your use case](https://mintcdn.com/qx-labs/IDpFCrarlNRzdNcz/images/api-reference/overview/api-access-light.png?fit=max\&auto=format\&n=IDpFCrarlNRzdNcz\&q=85\&s=a534ef5c02fb288e0922564b1d084bf5)

Once your request is approved, open [api.qxlabs.com](https://api.qxlabs.com), sign in with **Continue with QX**, and copy your key from the dashboard.

## Send a request

Every endpoint lives under `https://api.qxlabs.com/v1`. Send your key as a bearer token in the `Authorization` header. The `X-API-Key` header works too.

```bash cURL theme={null}
curl https://api.qxlabs.com/v1/responses \
  -H "Authorization: Bearer <YOUR_QX_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{"model": "builtin:qx_agent", "input": "Say hello in five words"}'
```

```python Python theme={null}
import requests

response = requests.post(
    "https://api.qxlabs.com/v1/responses",
    headers={"Authorization": "Bearer <YOUR_QX_API_KEY>"},
    json={"model": "builtin:qx_agent", "input": "Say hello in five words"},
)
# The agent's message is the last item in output
print(response.json()["output"][-1]["content"][0]["text"])
```

```typescript TypeScript theme={null}
import axios from "axios";

const response = await axios.post(
  "https://api.qxlabs.com/v1/responses",
  { model: "builtin:qx_agent", input: "Say hello in five words" },
  { headers: { Authorization: "Bearer <YOUR_QX_API_KEY>" } },
);
// The agent's message is the last item in output
console.log(response.data.output.at(-1).content[0].text);
```

Every endpoint page has a **Try it** button that sends the request from your browser with your key, so you can see a real response before you write any code.

## What you can call

> [card] [Agents](https://docs.qxlabs.com/api-reference/agents/send-a-message.md)
>
> Message any agent through OpenAI's Responses API, with files, streaming and approvals.

> [card] [Flows](https://docs.qxlabs.com/api-reference/flows/get-a-flow.md)
>
> Execute a flow with values for its input nodes and read each node's output.

> [card] [Grids](https://docs.qxlabs.com/api-reference/grids/get-a-grid.md)
>
> Execute a sheet, or part of it, and read its rows.

Your key covers the products an admin approved, so a call to another product's endpoint gets a 403. The agents endpoints follow OpenAI's Responses API, so [OpenAI's SDKs](https://docs.qxlabs.com/api-reference/openai-compatibility.md) work with your QX key.

## Limits and errors

Each product has its own limits on reads and writes per minute. A call over a limit gets a 429 with a message naming the limit. Flows and grids endpoints return errors as `{"error": "message"}`, with the app's own message when a flow or sheet can't execute or your org is out of credits. Agents endpoints return errors in OpenAI's shape, with `error.message`, `type`, `param` and `code`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.