1. Create an API key
Create an account, then open API keys and press Create key. Copy the secret when it is shown: it is displayed once.
Store it in an environment variable so it never ends up in your code:
Terminal
export API_KEY="pk_prev_your_key_here"2. Submit a request
Send the model inputs to the queue endpoint of black-forest-labs/flux-2-pro. The response arrives immediately with status 202 and a request_id.
curl -X POST "https://inferlane.net/api/v1/queue/black-forest-labs/flux-2-pro" \
-H "Authorization: Key $API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"A matte ceramic bottle on a stone ledge, soft window light","image_size":"square_hd","num_images":1}'202 Accepted
{
"request_id": "YmxhY2stZm9yZXN0LWxhYnMvZmx1eC0yLXByb3xtdXF6ZDB2c3wxLjA0OXwzODg5MDFhZnw5ZDkxMjg",
"model_id": "black-forest-labs/flux-2-pro",
"status": "IN_QUEUE",
"status_url": "https://inferlane.net/api/v1/requests/YmxhY2stZm9yZXN0LWxhYnMvZmx1eC0yLXByb3xtdXF6ZDB2c3wxLjA0OXwzODg5MDFhZnw5ZDkxMjg/status",
"response_url": "https://inferlane.net/api/v1/requests/YmxhY2stZm9yZXN0LWxhYnMvZmx1eC0yLXByb3xtdXF6ZDB2c3wxLjA0OXwzODg5MDFhZnw5ZDkxMjg",
"submitted_at": "2026-10-02T13:09:55.000Z"
}Save the id for the next steps:
Terminal
export REQUEST_ID="paste the request_id here"3. Poll the status
Call the status endpoint about once a second until status is COMPLETED.
curl "https://inferlane.net/api/v1/requests/$REQUEST_ID/status" \
-H "Authorization: Key $API_KEY"4. Fetch the result
curl "https://inferlane.net/api/v1/requests/$REQUEST_ID" \
-H "Authorization: Key $API_KEY"200 OK
{
"request_id": "YmxhY2stZm9yZXN0LWxhYnMvZmx1eC0yLXByb3xtdXF6ZDB2c3wxLjA0OXwzODg5MDFhZnw5ZDkxMjg",
"model_id": "black-forest-labs/flux-2-pro",
"status": "COMPLETED",
"sample": true,
"output": {
"images": [
{
"url": "https://inferlane.net/media/outputs/portrait-1x1.webp",
"width": 1024,
"height": 1024,
"content_type": "image/webp"
}
],
"seed": 421337
},
"billing": {
"unit": "megapixel",
"quantity": 1.049,
"unit_price": 0.03,
"amount": 0.03147,
"currency": "USD",
"sample": true
},
"timings": {
"queue_ms": 900,
"inference_ms": 2600
},
"submitted_at": "2026-10-02T13:09:55.000Z",
"completed_at": "2026-10-02T13:09:58.500Z"
}All three steps in one script
The same flow as one program. Run the JavaScript version with Node 18 or newer as an .mjs file, and the Python version with the requests package.
# 1. Submit the request and keep its request_id
REQUEST_ID=$(curl -s -X POST "https://inferlane.net/api/v1/queue/black-forest-labs/flux-2-pro" \
-H "Authorization: Key $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A matte ceramic bottle on a stone ledge, soft window light",
"image_size": "square_hd",
"num_images": 1
}' \
| sed -n 's/.*"request_id": *"\([^"]*\)".*/\1/p')
# 2. Poll the status about once a second until it is COMPLETED
until curl -s "https://inferlane.net/api/v1/requests/$REQUEST_ID/status" \
-H "Authorization: Key $API_KEY" | grep -q '"status": "COMPLETED"'; do
sleep 1
done
# 3. Fetch the result
curl "https://inferlane.net/api/v1/requests/$REQUEST_ID" \
-H "Authorization: Key $API_KEY"Every model page in the catalog shows this script with that model's inputs filled in.