Skip to main content
POST
/
v3
/
call
/
stream
Stream function by name
import requests

url = "https://api.opper.ai/v3/call/stream"

payload = {
    "input": "<unknown>",
    "name": "<string>"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "data": "<unknown>",
  "meta": {
    "execution_ms": 123,
    "function_name": "<string>",
    "image_gen_calls": 123,
    "llm_calls": 123,
    "script_cached": true,
    "tts_calls": 123,
    "cost": 123,
    "generation_ms": 123,
    "guards": [
      {
        "flagged": true,
        "type": "<string>",
        "findings": [
          "<unknown>"
        ]
      }
    ],
    "message": "<string>",
    "model_warnings": [
      "<string>"
    ],
    "models_used": [
      "<string>"
    ],
    "usage": {
      "input_tokens": 123,
      "output_tokens": 123,
      "cache_creation_1h_tokens": 123,
      "cache_creation_tokens": 123,
      "cache_read_tokens": 123,
      "reasoning_tokens": 123
    }
  }
}

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token.

Body

application/json
input
any
required

Any value

name
string
required
hints
object
input_schema
object

JSON Schema for the input. Optional; defaults to string when omitted.

instructions
string
model
string
output_schema
object

JSON Schema for the output. Optional; defaults to string when omitted.

parent_span_id
string
tools
object[]

Response

Successful response

data
any
required

Any value

meta
object