AI Gateway
Images
POST
Pass-through to the provider’s images endpoint (generation, editing, variations). Request and response bodies follow the standard OpenAI Images API schema. The provider is inferred from the model name (e.g.
dall-e-3, gpt-image-1 route to OpenAI).
Image requests pass through to your provider and work today. They are not yet counted toward your cost totals, because the Images API does not return token usage. Full cost tracking for images is coming soon.
Headers
Your Toolken API key. Validated by the gateway and stripped before forwarding.
Your provider key in Bearer format (BYOK), e.g.
Bearer sk-.... Forwarded untouched, never stored.Primary attribution channel. JSON object of key-value pairs (e.g.
{"agent":"research-agent","customer_id":"cust_abc"}). Each key becomes a groupable dimension in the dashboard.Flat-header shorthand.
X-Toolken-Metadata-Agent: research-agent writes metadata key agent. Equivalent to sending the same key in X-Toolken-Metadata.Sets the
feature metadata key. Use to group costs by agent name, workflow, UI surface, or job type.Sets the
customer_id metadata key. Use to attribute costs to an end-customer, org slug, or account ID.Body
Image model identifier (e.g.
dall-e-3, gpt-image-1).Text description of the image to generate.
Number of images to generate. Defaults to 1.
Image dimensions (e.g.
1024x1024). Supported values depend on the model.Response
Unix timestamp of when the request was processed.
Array of generated image objects. Each contains a
url or b64_json field depending on the requested response format.