AI agents
One user action becomes dozens of model calls. That changes which parts of the platform matter.
What is different about agents
- The cost is in the volume of calls, not any single one.
- When a run goes wrong you need to inspect one step, not a daily total.
- An unattended loop needs a ceiling it cannot exceed.
Per-step visibility
Keep the X-Astrodyne-Request-Id from each call next to your own
trace id. When a run misbehaves you can open that exact step in the
Request Explorer and see the model, the
tokens, the latency and the charge.
Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.astrodyne.ai/v1",
api_key=os.environ["ASTRODYNE_API_KEY"])
def step(messages, *, trace_id):
raw = client.chat.completions.with_raw_response.create(
model="YOUR_MODEL_ID",
messages=messages,
)
# Store this next to your own trace so a bad step is findable later.
log(trace_id=trace_id,
astrodyne_request_id=raw.headers.get("X-Astrodyne-Request-Id"))
return raw.parse()
Giving a loop a ceiling
- Run agents on a dedicated API key with its own monthly spending limit.
- The prepaid balance is the absolute ceiling — there is no credit line to overrun.
- Cap your own iteration count. The platform cannot know that step 40 is a loop.
Choosing models per step
Plan steps and final answers often warrant a frontier model; classification and routing steps rarely do. Because the model is one field in the request, mixing them costs nothing structurally. Astrodyne runs the model you name — it does not choose one for you.