# Inference contract

What a deployed agent’s statuses mean, when it is billed, and what its endpoint accepts. How to deploy is on [Deploy an agent](../guides/deploy-an-agent.md). How to call it is on [Invoke an agent](../guides/invoke-an-agent.md).

## Deployment statuses

The agent card on **Agents** and the header of the agent’s page show the same status, with two differences: a failed deploy reads **Deployment failed** on the card and **Failed** in the header, and on your own cluster the card reads **Copying** while the header reads **Deploying**.

| Status                             | What it means                                                                                                                                      | What to do                                                                   |
|------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| **Not deployed**                   | Inference is off. It has not been started.                                                                                                         | **Connect** on the card, or **Deploy** on the agent’s page                   |
| **Copying**                        | On your own cluster, the checkpoint is being copied.                                                                                               | Wait. **Disconnect** on the card or **Cancel** on the agent’s page stops it. |
| **Deploying**                      | Inference is starting. On Arena cloud this includes copying the checkpoint.                                                                        | Wait. **Disconnect** or **Cancel** stops it.                                 |
| **Deployed**                       | Inference is up. The agent’s page shows the endpoint and code snippets.                                                                            | Call it. **Disconnect** or **Stop agent** turns it off.                      |
| **Stopped**                        | Turned off while starting or running: you disconnected it, an Arena admin stopped it, or the organization’s balance could not cover the next hour. | **Connect** or **Deploy** starts it again                                    |
| **Deployment failed** / **Failed** | The deploy, or a later health check, failed. The agent’s page shows the reason.                                                                    | Fix the cause, then **Connect** or **Deploy** to try again                   |

Going from **Deploying** to **Deployed** usually takes a minute and a half or more, longer for large checkpoints.

A **Deployed** agent goes back to **Deploying** if Arena finds its endpoint unreachable. That usually clears by itself.

On Arena cloud, while no GPU machine is free for the deployment, the card shows **Waiting for capacity**. Arena keeps trying for up to 24 hours, and that time isn’t charged. Once a machine runs the deployment, it has 90 minutes to become healthy, counted from when the machine arrives. If it isn’t healthy by then, it is stopped, marked failed, and you get a notification. If it was **Deployed** for less than 30 minutes before it fell back to **Deploying**, it keeps counting from when it first started waiting. Thirty minutes or more of **Deployed** starts the count over. On your own cluster there is no time limit.

## Billing

An agent is billed by the hour only while it is **Deployed**. **Copying** and **Deploying** are free. See [Billing and credits](../account/billing.md).

## Calling the endpoint

Every agent Arena trains is a language model, and it answers on one path: **generate**, appended to the **Endpoint** shown on the agent’s page. The chat playground uses the same path.

Once the agent is **Deployed**, its page has a **Chat Playground** and three snippet tabs:

| Tab              | Use it for                                     |
|------------------|------------------------------------------------|
| **Arena client** | Python, with `ArenaClient` from `agilerl`      |
| **Arena CLI**    | The shell: `arena agent generate`              |
| **Manual HTTP**  | Any HTTP client. The snippet has the full URL. |

All three sign in with `arena login` or `ARENA_API_KEY`. A manual request sends the key as a `Bearer` token in the authorization header.

A generate request takes:

- `session_id`: a name for the conversation. Requests with the same `session_id` share its history. A request without one is refused with a 422 error.
- `prompts`: one prompt or a list of prompts.
- `params`, optional: `max_new_tokens`, `temperature`, `top_p` and `do_sample`.

The reply has one result per prompt, each with its `prompt` and `completion`.

Copy the snippet from the agent’s page rather than building the URL yourself.

While an agent is not **Deployed**, its page shows no endpoint.
