Invoke an agent

Once a deployment is Deployed and connected, expand its row on the Agents page. The expanded panel shows credentials and copy-paste examples built from the deployment’s algorithm and environment type.

You need both API key and Endpoint before snippets render. Classic RL and Advanced Training load them the same way after status is Deployed.

Components block

At the top:

Field

Use

API key

Bearer token for inference HTTP

Endpoint

Base URL for the deployment; the Manual HTTP snippet adds the path suffix

Copy icons copy each value. Rotate deployment API key opens a confirmation dialog; after confirm, the old key stops working immediately.

The Arena client tab uses the Python client with your deployment name. The Manual HTTP tab shows raw requests using the values in this block. The Arena CLI tab appears for LLM deployments only.

Deployment code tabs

Under Deployment code, you get Arena client and Manual HTTP for every deployment, plus an Arena CLI tab for LLM deployments (beside Chat playground):

Tab

When to use

Arena client

Recommended Python path: ArenaClient from agilerl.arena.client

Arena CLI

LLM deployments only: arena agent generate after arena login or ARENA_API_KEY

Manual HTTP

Raw requests.post with URL and Bearer token as shown in the snippet

The snippet variant depends on algorithm and environment shape:

Situation

Arena client

Manual HTTP (paths shown in snippet)

Single-agent Gym

open_inference_agent + get_action loop

POST with get_action suffix and numpy serialize helpers

Recurrent PPO

Same with hidden_state threaded each step

Same suffix; body includes serialized hidden_state

PettingZoo / multi-agent

Dict observations per agent

Same suffix; action_mask and env_defined_actions in payload

LLM

open_inference_agent then generate

POST with generate suffix

Supervised

Arena client tab as shown

POST with predict suffix

Classic RL uses gym-style examples. Recurrent PPO is detected by algorithm name. LLM algorithms use generate examples and expose the chat UI.

Payload and URL details match what the Manual HTTP tab prints. See Inference contract for status and suffix overview.

Arena client (sketch)

Gym loop:

from agilerl.arena.client import ArenaClient

with ArenaClient() as client:
    client.login()
    with client.open_inference_agent("YOUR_DEPLOYMENT_NAME") as agent:
        state, info = env.reset()
        for _ in range(10):
            action, _ = agent.get_action(state, batched=False, info=info)
            state, *_, info = env.step(action)

LLM: the UI snippet opens the agent with open_inference_agent(DEPLOYMENT_NAME), then calls generate on it (which posts to the generate path with a prompts list and params like max_new_tokens, temperature, top_p, do_sample). Copy the full example from the panel.

Arena CLI

Shown for LLM deployments only. After arena login (or ARENA_API_KEY):

arena agent generate YOUR_DEPLOYMENT_NAME --prompt "Your prompt here"

The command streams the completion to your terminal. Classic RL and supervised deployments have no Arena CLI tab — use the Arena client or Manual HTTP tab instead.

Manual HTTP

Manual examples base64-encode numpy observations for the get_action path. Authorization is Bearer <api_key> (the snippet adds the prefix). You paste Endpoint and API key from the Components block; no separate Platform login.

Copy the Classic RL or LLM snippet exactly as rendered in the Manual HTTP tab. It already combines your endpoint with the correct path suffix.

Chat playground

For advanced LLM deployments only, the panel defaults to a Chat playground tab when the algorithm is in the LLM family. Supervised, LatentPPO, and Classic RL do not get this tab.

The playground posts to your endpoint on the generate path with the deployment API key. It formats multi-turn text as User: / Assistant: lines and reads completions from the first result row.

Switch to Deployment code for the Python examples.

Expand row requirements

Tab

Row expands when

Classic RL

Status is Deployed and the agent is connected

Advanced Training

Linked deployment status is Deployed

If you see “No deployment found for this agent”, click Connect first or wait until status leaves Pending.

External callers

Anything that can send HTTPS requests can call the endpoint if it uses the same URL, Bearer token, and JSON body as the Manual HTTP snippet:

  • Classic RL: get_action (full URL in snippet)

  • LLM: generate

  • Supervised and LatentPPO: predict

If status drops from Deployed to Pending or Failed, calls may fail until you reconnect. See Inference contract.

See also