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

# API reference

> The Onecortex public API: one operation to invoke a deployed agent. Base URL, authentication, errors and rate limit headers.

The public API is one operation: [invoke an agent](/api-reference/overview#the-operation). Everything else, creating agents, deploying, configuration and keys, is done in the dashboard. The dashboard's own API is not a public interface, and may change without notice.

<Warning>
  The playground on the operation's page calls `https://api.onecortex.io` with your key: it answers once your organization is live there. During the private beta, use the dashboard's [chat console](/observe/chat) or [curl](/call/curl) to try an agent.
</Warning>

## Base URL

```text theme={null}
https://api.onecortex.io
```

HTTPS only.

## Authentication

Every call carries an API key as a bearer token:

```http theme={null}
Authorization: Bearer $ONECORTEX_API_KEY
```

Create a key under **API keys** in the dashboard. It is shown once, when you create it. See [API keys](/call/api-keys).

## Errors

A request refused before the run starts answers with an HTTP status and this body:

```json theme={null}
{
  "error": {
    "code": "not_found",
    "message": "That agent does not exist.",
    "requestId": "req_01K..."
  }
}
```

`code` is stable, and safe to branch on. `message` is for people, and may change. Every code, its status and what to do is on [Errors](/production/errors#invoke-errors).

## Rate limit headers

| Header | Holds |
| - | - |
| `X-RateLimit-Remaining` | Requests left in your organization's burst allowance |
| `Retry-After` | On `429`: whole seconds to wait |

The limits are on [Limits](/production/limits#invoke).

## The operation

`POST /v1/agents/{agentId}/invoke`: the request, both response shapes and every event are on its page in this tab, and explained with examples on [the invoke API](/call/invoke).
