Skip to main content
This reference is for the team implementing your agent endpoint. It defines version 1 of the harness protocol, including the four routes Oumi calls during an evaluation. To connect an existing endpoint through the UI, see Register a harness.

Download the OpenAPI spec

OpenAPI 3.1 definition of the four routes, their request and response bodies, and the status object.
Each route is appended to the endpoint URL’s path. A harness registered at https://agents.example.com/eval receives POST https://agents.example.com/eval/submit.

CONVENTIONS

  • Requests and responses are JSON. Oumi sends its stored credential on every call, and Content-Type: application/json on POST requests. GET requests carry no body.
  • Every successful response includes protocol_version, session_id, and invocation_id matching the submitted invocation.
  • Oumi omits fields with null values. Responses must contain only the fields defined in this protocol.
  • Responses must be uncompressed. Oumi sends Accept-Encoding: identity.
  • Respond to each request within 30 seconds. Request and response bodies must not exceed 10 MiB.

SESSIONS AND INVOCATIONS

Oumi creates one session per dataset row. Each session contains one invocation, which represents the agent’s turn. A turn can pause for user input and resume multiple times before completing.
  • A resume continues the same invocation, with the same invocation_id.
  • Oumi does not send an end-of-session request. Your harness manages session retention and must preserve state while the row is active.
  • Your harness manages its tools, memory, and working state. Oumi assembles the evaluation transcript from the opening messages, collected harness output, and simulated user replies.

MESSAGES

Messages follow the OpenAI chat format. Throughout a session:
  • Tool call IDs are non-empty and unique.
  • Every tool call is answered by exactly one tool message before the next non-tool message.
  • A turn may leave its final tool calls unanswered only when its status is input_required. These calls represent questions for the user.

API SPEC

Oumi calls these four routes on your endpoint. Each section lists the request body, the expected response, and the status codes Oumi handles.

SUBMIT

POST {endpoint}/submit

REQUEST BODY

  • start: the row’s opening conversation, ending with a user message. Start a new session with it.
  • resume: only tool messages, with one reply for each pending tool call. Resume the existing invocation with these replies.

RESPONSE

Respond with the invocation’s status. The HTTP status depends on whether the turn is still in progress: The response body is a status object. get_status and cancel return the same object.
If a submission times out or its response is lost, Oumi retries with the same invocation_id, session_action, and input_messages, but a fresh model_connection.api_key. Deduplicate on invocation_id, not on the full body. Repeated submissions must be idempotent: return the current status without restarting the turn or applying the same resume twice.

GET_STATUS

GET {endpoint}/get_status?invocation_id={invocation_id}

REQUEST

No request body. The invocation ID is passed as the invocation_id query parameter.

RESPONSE

Return 200 OK with the same status object as submit. When the status is failed, include an error object with a non-empty message string that explains the failure:
error must be present when the status is failed, and only then. Oumi logs the first 1,000 characters of the message for troubleshooting; it does not use the message to determine how to handle the failure. Do not include credentials, such as the model API key, in the message. Return 404 Not Found for an unknown invocation. Returning 404 for a submitted invocation fails the entire evaluation.

COLLECT_OUTPUT

GET {endpoint}/collect_output?invocation_id={invocation_id}

REQUEST

No request body. The invocation ID is passed as the invocation_id query parameter.

RESPONSE

When the status is input_required or completed, return 200 OK with the messages generated since the most recent submission. Do not include earlier messages from the session. For input_required, the final assistant message contains the tool_calls that require user input:
Oumi then resumes with a tool message whose tool_call_id is call_1. The tool name is up to your harness. Oumi answers every call left pending at the end of an input_required turn. Return 409 Conflict if output is not yet available. Oumi waits and retries.

CANCEL

POST {endpoint}/cancel

REQUEST BODY

RESPONSE

Return 200 OK with the same status object as submit, reflecting the current status. If cancellation is still in progress, you can return a non-terminal status. Oumi polls get_status until the turn reports cancelled, completed, or failed. If the harness does not confirm a terminal status within the cancellation timeout, the evaluation fails. Oumi requests cancellation when the evaluation is cancelled, the turn exceeds its 15-minute processing limit, or an error prevents the turn from continuing.

MODEL CONNECTION

Each submit request includes a model_connection object:
  • The key authorizes only POST /v1/chat/completions requests for the specified model.
  • Use the connection from the latest submission. Each resume includes a new key.
  • The key expires when the evaluation completes, is cancelled, or fails, or after 12 hours, whichever comes first.
  • Don’t store or log the key.

ERRORS

Oumi handles HTTP responses and transport errors as follows: Row failures do not stop other rows. Oumi scores completed rows and reports the number of failures. Oumi does not follow redirects.