Docs

API reference.

One endpoint. One shape. Every model.

Authentication

Every request needs a bearer token. Create and rotate keys under API keys.

Authorization: Bearer <your-api-key>

Quickstart

Pick a model and run the request. The snippet updates in real time.

Model
# Submit
curl https://api.tryinfer.com/v2/inference/flux-schnell/text-to-image \
  -H "Authorization: Bearer $INFER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "prompt": "a single ripe banana wearing tiny sunglasses on a beach, photoreal",
      "num_images": 1,
      "aspect_ratio": "1:1"
    }
  }'
# → {"request_id": "..."}

# Poll until status is COMPLETED, FAILED, or CANCELLED
curl https://api.tryinfer.com/v2/inference/requests/$REQUEST_ID \
  -H "Authorization: Bearer $INFER_API_KEY"

Errors

The poll endpoint returns 200 OK with the run's terminal state. status is one of COMPLETED, FAILED, or CANCELLED; FAILED carries the upstream message in error.

CodeMeaning
401Missing or invalid bearer token
422Input failed validation against the model's schema
5xxUpstream provider unreachable or returning an error