Docs
One endpoint. One shape. Every model.
Every request needs a bearer token. Create and rotate keys under API keys.
Authorization: Bearer <your-api-key>
Pick a model and run the request. The snippet updates in real time.
# 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"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.
| Code | Meaning |
|---|---|
401 | Missing or invalid bearer token |
422 | Input failed validation against the model's schema |
5xx | Upstream provider unreachable or returning an error |