Sign in at platform.opper.ai and create a key. Each key belongs to one project, so make a new project for each app or environment.Calls draw from your account balance, so add credits under Billing before your first call.Put the key in your shell:
export OPPER_API_KEY="your-api-key"
2
Pick an API and run your first call
There are two patterns. The Chat API is multi-turn chat with messages and tools, which suits chatbots and agents. The JSON API handles one-shot tasks: send an input, get a typed JSON object back. Pick the one that matches what you’re building.
Chat API
JSON API
Messages with roles, optional tools, multiple turns. It works with the OpenAI, Anthropic, and Google AI SDKs.
The same trick works with the Anthropic and Google AI SDKs. See Drop-in SDKs for all three.
One task per request. Send an input, describe the shape you want back, and get a typed JSON object. It works well for parsing, extraction, and multimodal jobs. Here we read a receipt image straight from a URL and pull out the structured data.
import osfrom pydantic import BaseModelfrom opperai import Opperclass Item(BaseModel): name: str quantity: float | None = None price: floatclass Receipt(BaseModel): store_name: str date: str items: list[Item] subtotal: float tax: float total: floatopper = Opper(http_bearer=os.getenv("OPPER_API_KEY", ""))result = opper.call( name="parse-receipt", model="anthropic/claude-sonnet-4-6", instructions="Extract all line items, totals, and metadata from this receipt image.", input={"image_url": "https://expensesreceipt.com/assets/img/standard-grocery-receipt-template.png"}, input_schema={ "type": "object", "properties": {"image_url": {"type": "string", "description": "URL of the receipt image"}}, "required": ["image_url"], }, output_schema=Receipt,)print(result.json_payload)
Open platform.opper.ai and click into the most recent trace. You’ll see your call, the model that ran it, the cost, the latency, and any Control Plane rules that fired.