curl --request POST \
--url https://api.opper.ai/v3/compat/v1beta/interactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": "<unknown>",
"input": "<unknown>"
}
'import requests
url = "https://api.opper.ai/v3/compat/v1beta/interactions"
payload = {
"contents": "<unknown>",
"input": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({contents: '<unknown>', input: '<unknown>'})
};
fetch('https://api.opper.ai/v3/compat/v1beta/interactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "<string>",
"agent": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"id": "<string>",
"model": "<string>",
"previous_interaction_id": "<string>",
"role": "<string>",
"steps": [
{
"type": "<string>",
"arguments": {},
"content": [
{
"data": "<string>",
"role": "<string>",
"text": "<string>",
"type": "<string>",
"uri": "<string>"
}
],
"id": "<string>",
"name": "<string>",
"signature": "<string>",
"summary": {
"data": "<string>",
"role": "<string>",
"text": "<string>",
"type": "<string>",
"uri": "<string>"
}
}
],
"usage": {
"total_cached_tokens": 123,
"total_input_tokens": 123,
"total_output_tokens": 123,
"total_thought_tokens": 123,
"total_tokens": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"error": {
"code": "<string>",
"details": {
"allowed_models_url": "<string>",
"docs_url": "<string>",
"list_url": "<string>",
"lock_url": "<string>",
"reason": "model_access_lock_blocked"
},
"message": "<string>"
},
"status": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}Interactions
Google Interactions API compatible endpoint. Supports streaming via the stream parameter.
curl --request POST \
--url https://api.opper.ai/v3/compat/v1beta/interactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": "<unknown>",
"input": "<unknown>"
}
'import requests
url = "https://api.opper.ai/v3/compat/v1beta/interactions"
payload = {
"contents": "<unknown>",
"input": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({contents: '<unknown>', input: '<unknown>'})
};
fetch('https://api.opper.ai/v3/compat/v1beta/interactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "<string>",
"agent": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"id": "<string>",
"model": "<string>",
"previous_interaction_id": "<string>",
"role": "<string>",
"steps": [
{
"type": "<string>",
"arguments": {},
"content": [
{
"data": "<string>",
"role": "<string>",
"text": "<string>",
"type": "<string>",
"uri": "<string>"
}
],
"id": "<string>",
"name": "<string>",
"signature": "<string>",
"summary": {
"data": "<string>",
"role": "<string>",
"text": "<string>",
"type": "<string>",
"uri": "<string>"
}
}
],
"usage": {
"total_cached_tokens": 123,
"total_input_tokens": 123,
"total_output_tokens": 123,
"total_thought_tokens": 123,
"total_tokens": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"error": {
"code": "<string>",
"details": {
"allowed_models_url": "<string>",
"docs_url": "<string>",
"list_url": "<string>",
"lock_url": "<string>",
"reason": "model_access_lock_blocked"
},
"message": "<string>"
},
"status": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}Authorizations
Headers
Comma-separated key:value usage-attribution tags (e.g. tenant:acme,project:demo, max 8). Recorded on the generation's billing/metrics rows; group spend by any key via GET /v2/analytics/usage?group_by=. Header-borne twin of the /v3/session URL prefix tags (which win per key when both are present); opper.-prefixed keys and session_id are reserved. Malformed values return 400.
Body
Opt in to automatic prompt caching for Anthropic-family models routed through this Gemini-shape endpoint: {"type":"ephemeral"} (optionally "ttl":"1h"). Places one moving cache breakpoint on the largest cacheable prefix. Caching is off unless set; no-op on Gemini and other providers with automatic server-side caching. Cache writes cost 1.25x input and reads 0.1x
Fallback models tried in order when the model before them fails for any reason (provider error; rate limit; timeout; a member blocked by one of your rules). Same OpenRouter shape: send the primary in model (or agent) and the rest here; or omit both and the first entry is the primary. Each entry is any model string: a bare pooled name; a provider/model id; an org alias. Not allowed together with a dynamic/ route. At most 10 entries. Which model answered is in the X-Opper-Served-Model header.