Getting started
Quickstart
Run your first task in three steps: add balance and an API key, submit a task, fetch the result.
1. Add balance and create an API key
- Sign in and top up on the Pricing page. Your balance is in US dollars and never expires.
- Create a key on the API keys page of the console. The key is shown once: store it safely and keep it out of browser or app code.
To see results before writing code, open any model page and use the playground. Playground runs are billed to your balance like API calls.
2. Submit a task
Image, video and audio models share one endpoint. It returns a task ID right away and generates in the background:
curl https://janvia.io/v1/tasks \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"input": { "prompt": "a red fox in the snow", "resolution": "2K" }
}'The response is HTTP 202 with the task object, status set to queued. What model and input accept is on each model page under Parameters, and in Models and parameters.
3. Fetch the result
Poll the task until status is completed or failed:
curl https://janvia.io/v1/tasks/TASK_ID \ -H "Authorization: Bearer $API_KEY"
When it completes, output.files holds the generated files, each with a url, type and mime_type.
To skip polling, pass callback_url when you submit and we post the result to you when the task ends. See Callbacks.
Failed tasks cost nothing: the charge is refunded in full.