Python
import requests url = "https://api.opper.ai/v3/functions/{name}/call" 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 } } }
Execute a function with the given input. If no cached script exists, one is generated automatically.
API key authentication. Pass your API key as a Bearer token.
Function name
Any value
Show child attributes
JSON Schema for the input. Optional; defaults to string when omitted.
JSON Schema for the output. Optional; defaults to string when omitted.
Successful response