Skip to main content
POST
LLM Inference with Receipt
Records an individual LLM inference call that occurred within a running orchestration. Each inference record captures the model, provider, token counts, latency, cost, and content hashes — enabling fine-grained cost attribution and provenance auditing of every AI decision. This endpoint is called by agent runtimes after each LLM API call completes. The inference record is linked to the parent orchestration and included in the final transparency-log receipt.

Authentication

string
required
API key with orchestrations:write scope. Alternatively, pass a Bearer JWT token in the Authorization header.
string
required
Tenant identifier for multi-tenant isolation.

Path Parameters

string
required
Parent orchestration identifier (maip-orch:ULID). Must be in running status.

Request

string
required
LLM model identifier (e.g. claude-sonnet-4-20250514, gpt-4o, amazon.titan-text-express).
string
required
LLM provider. Accepted values: openai, anthropic, bedrock, custom.
integer
Number of input tokens consumed by the inference call.
integer
Number of output tokens generated by the inference call.
integer
End-to-end latency of the inference call in milliseconds.
number
Cost of the inference call in US cents. Calculated by the agent runtime based on provider pricing.
string
SHA-256 hex digest of the prompt input. Enables verification that the exact input can be reproduced.
string
SHA-256 hex digest of the model output. Enables verification that the recorded output matches what was returned.

Response

string
Unique identifier for this inference record.
string
Parent orchestration identifier.
string
LLM model used.
string
LLM provider.
integer
Input token count.
integer
Output token count.
number
Inference cost in US cents.
string
ISO 8601 timestamp when the inference was recorded.

Authorizations

X-API-Key
string
header
required

API key for machine-to-machine authentication

Body

application/json
model
string
required

Model identifier (e.g. gpt-4, claude-3)

prompt
string
required

Input prompt

agent_id
string<uuid>
required

Invoking agent

parameters
object

Model parameters (temperature, max_tokens, etc.)

Response

Inference result with receipt

response
string
receipt_id
string<uuid>
tokens_used
integer
cost
number<float>