Python
import requests url = "https://api.opper.ai/v3/compat/chat/completions" payload = { "messages": [ { "content": "<unknown>", "role": "<string>", "name": "<string>", "tool_call_id": "<string>", "tool_calls": [ { "function": { "arguments": "<string>", "name": "<string>" }, "id": "<string>", "type": "<string>", "thought_signature": "<string>" } ] } ] } headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.text)
{ "choices": [ { "finish_reason": "<string>", "index": 123, "message": { "content": "<string>", "role": "<string>", "tool_calls": [ { "function": { "arguments": "<string>", "name": "<string>" }, "id": "<string>", "type": "<string>", "thought_signature": "<string>" } ] } } ], "created": 123, "id": "<string>", "model": "<string>", "object": "<string>", "usage": { "completion_tokens": 123, "prompt_tokens": 123, "total_tokens": 123 } }
OpenAI-compatible chat completions endpoint. Supports streaming via the stream parameter.
API key authentication. Pass your API key as a Bearer token.
Show child attributes
Any value
Successful response