Skip to content

DocsGet started

INFRO documentation

INFRO is one control plane over the AI provider accounts you already hold: one API, routing and failover, per-request cost, observability and policy.


INFRO sits between your application and the AI providers you already pay. You connect your own provider accounts and call one API; INFRO picks a connection for each request, tries the next one when it fails, records what each request used as your provider reports it, and estimates what your provider will bill you for it. Your providers invoice you directly — INFRO takes 0% of model spend and charges a subscription for the control plane.

Text, image, video, and audio share the same base URL, the same key, the same error model, and the same request extensions. A modality is served only when one of your connections serves it: most provider kinds serve text, and several serve images, audio or video (Connect a provider lists what each kind serves).

Base URL
https://api.infro.io/v1

What you get

  • One integration across your providers. Chat completions, image generation and editing, speech synthesis, transcription and video jobs, over whichever of your accounts can serve them — all documented under Modalities.
  • 0% markup on model spend. Requests run on the provider accounts you connect, so your providers invoice you directly at whatever you negotiated with them and INFRO takes no part of it. What INFRO charges for is the platform — see billing.
  • Resilience beyond any one provider. Health-aware routing and failover move a request to your next connection or route target when a provider times out or errors before the response starts.
  • Every request, on the record. Request-level traces carry the model, the connection that served it, the route, latency, and estimated provider cost — grouped by your users and sessions, exportable to your stack.
  • Attribution across every provider. Estimated provider cost broken down by model, connection, project and key, with per-key spend limits and request-level export — see Rate & spend limits.
  • Governance built in. Members and roles, spend ceilings, model allowlists, and an audit log — one account the whole company can use.

The endpoints

ModalityEndpointShapeMetered per
TextPOST /v1/chat/completionsSynchronous or streamingToken
ImagePOST /v1/images/generations, POST /v1/images/editsSynchronousImage
VideoPOST /v1/videosAsync job + webhookSecond of output
SpeechPOST /v1/audio/speechSynchronous or streamingCharacter
TranscriptionPOST /v1/audio/transcriptionsSynchronousHour of audio
EmbeddingsPOST /v1/embeddingsSynchronousToken
Agent APIsPOST /v1/messages, POST /v1/responsesSynchronous or streamingToken

Embeddings keep OpenAI's shape. The agent APIs take Anthropic's Messages and OpenAI's Responses shapes for coding agents and agent SDKs (Claude Code & Codex). Decisions (POST /v1/decisions/{slug}), Rerank (POST /v1/rerank) and cost estimates before a request (POST /v1/estimates) have their own pages.

How a request flows

  1. Your app calls an endpoint with an INFRO API key and a model id like bfl/flux-2-pro, or the slug of a route.
  2. INFRO validates the key, applies its rate limit and checks the organization has an active trial or plan.
  3. INFRO resolves the model to the targets of a named route, or to the provider connections you have added for that vendor, checks your budgets against the request's worst-case cost, and forwards it in the provider's native format. Without a route, providers are tried in the order you connected them, and requests are spread across one provider's active keys; standby keys, and keys that just answered 429 or said they cannot serve the model, are tried after the others.
  4. If an attempt times out or fails before the response begins, INFRO tries the next target or connection — and, on a request that names a model rather than a route, can fall back to another model if you configured fallbacks. Once a response has started streaming, a drop surfaces as an error your client retries.
  5. Long-running work (video, large batches) becomes an async job you receive by webhook.
  6. Usage is metered per unit and appears in your dashboard and export within seconds. Every response carries usage.cost, the estimated provider cost — null when the model is unpriced.

Routing is designed against an overhead target of under 40ms; INFRO does not publish a measured figure. Against generation time that is noise, but measure on your own traffic if you stream audio or otherwise care about time-to-first-byte.

A complete request

import os
from infro import Infro

client = Infro(api_key=os.environ["INFRO_API_KEY"])

# The Python SDK returns plain dicts.
image = client.images.generate(
    model="bfl/flux-2-pro",
    prompt="studio product shot, soft rim light",
)
print(image["data"][0]["url"], image["usage"].get("cost"))

Text requests keep the OpenAI-compatible shape, so an existing OpenAI integration only needs a new base URL and key — see Chat completions.

Where to go next

↑ ↓ navigate↵ open/ anywhere in docs