Responses API Contract
Agnitra uses the OpenAI Responses API to translate profiler telemetry into kernel tuning recommendations. This reference covers request schemas, tooling payloads, and operational guardrails.Base URL
Authentication
Store API keys in a secrets manager or environment variable. Never expose them in client-side code.
Request Schema
modelmust reference a Responses-capable deployment (e.g.gpt-5-codexorgpt-5-mini). Do not use deprecated parameters such astemperatureormax_output_tokens.inputaccepts text or image content. Agnitra sends JSON-formatted telemetry snippets.toolsunlock structured responses via function calling; strict schemas avoid invalid payloads.metadatacaptures attribution for usage metering and billing.
Response Structure
- Parse
tool_callsand validate against the schema before mutating kernels. usage.total_tokensfeeds into Agnitra’s cost telemetry pipeline.
Rate Limits & Diagnostics
- Inspect
x-ratelimit-*headers to understand remaining token/request budgets. - Log the
x-request-idheader for each call to accelerate support escalation. - Retry with exponential backoff on
429and5xxresponses; avoid retrying validation errors.
Error Handling
Security Checklist
- Rotate API keys regularly and scope them to the minimum required access.
- Sanitize telemetry content to avoid leaking customer identifiers.
- Validate every tool-call payload against the defined JSON schema prior to execution.
Related Documentation
- Runtime Configuration — environment variables that toggle Responses API usage.
- SDK & CLI Guide — how responses inform local optimisation flows.
- Architecture Overview — where Responses API fits in the optimization loop.