Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.opper.ai/llms.txt

Use this file to discover all available pages before exploring further.

You can pass an explicit model on every call, or you can hand off the choice to Opper and just say what you’re optimizing for. Hints are how you do the second thing.

prefer: pick by goal, not by name

preferWhat Opper picks
cheapThe lowest-cost model that can handle your task.
fastThe model with the lowest latency.
qualityThe most capable model available, regardless of cost.
balanced (default)A reasonable trade-off across the three.
import os
from opperai import Opper

opper = Opper(http_bearer=os.getenv("OPPER_API_KEY", ""))

result = opper.call(
    name="summarize",
    instructions="Summarize the input in one sentence.",
    input="Opper is a single API for 300+ AI models with built-in observability.",
    hints={"prefer": "cheap"},
)
print(result.json_payload)

Other hints

Standard generation parameters work too.
HintWhat it does
temperature0 to 2. Lower is more deterministic. Default depends on the model.
top_p0 to 1. Nucleus sampling.
max_tokensCaps the output length.
reasoning_effortlow, medium, high. Only used by reasoning models.
Python
result = opper.call(
    name="parse-receipt",
    instructions="Extract merchant and total.",
    input="Starbucks\n2x Latte\nTotal: $10.25",
    output_schema=Receipt,
    hints={"prefer": "cheap", "temperature": 0.0},
)

How hints interacts with model and Route

There are three layers of model selection, and the most specific one wins:
  1. Explicit model parameter on the call. Always wins, as long as Comply allows it.
  2. Route rule for the scope. Used if the call didn’t pass model.
  3. hints.prefer plus the Comply allowlist. Used if neither of the above is set.
You can combine hints and model. The prefer hint is ignored when model is set, but other hints (temperature, top_p, etc.) still apply.
Start with prefer: "balanced" everywhere. Switch a call to cheap once you’ve measured its quality with Observe and confirmed it holds up.

What’s next

Calls

The basics of the JSON API.

Route

Set a default model at the scope level.

Models

Browse what prefer picks from.