v2

latestOpenAPI 3.1.02026-08-05267431678.1 KB
agent-chat-sessions

Report Mle Agent Turn Billing

Crash-safe per-turn billing endpoint for MLE chat sessions.

Args: request: FastAPI request used by the rate-limiter. session_id: agent_chat_sessions.id for the active chat. body: Per-turn usage payload with dedup key. auth: Authenticated caller; must own session_id.

Returns: AgentTurnBillingResponse with request_id and billed flag.

Raises: HTTPException: 404/403 for ownership failures.

post/mle-agent/sessions/{session_id}/billing/agent-turn

Path parameters

session_idstring required

Request body

turn_idstring required

Sandbox-supplied dedup key for this turn (UUID recommended).

providerstring required
modelstring required
input_tokensinteger
output_tokensinteger

Response

Successful Response

request_idstring nullable

Normally null for accepted compatibility self-reports; may contain a cached legacy requests row id for old dedup entries.

billedboolean required

False for accepted compatibility self-reports; brokered sandbox LLM usage is billed server-side on /v1/messages.