Skip to content

AI generation API quickstart

Generate your first image with the FreeInd API in five minutes — create a key, submit a generation, poll for completion, and download the output.

See it in action

This is a real generation running on the platform — studio, submit, and the result, end to end:

FreeInd AI generation studio with a prompt, model picker, and estimated cost
The generation studio: choose a mode and model, write a prompt, and review the estimated cost before submitting.

Prerequisites

  • A FreeInd account with a workspace — sign up at free.ind.in/signup
  • Base URL: https://free.ind.in/v1
  • Authentication: Authorization: Bearer <API key> — keys start with fi_live_

Note

The interactive OpenAPI reference is available at free.ind.in/api/docs, with the full endpoint list in the API reference.

1. Create an API key

Go to Dashboard → API Keys → Create. Pick a name and the scopes you need (start with generations.write, generations.read, and assets.read). The full key is shown exactly once — store it in your secrets manager.

Keys belong to one workspace. Keep the workspaceId handy; every request targets the workspace by id. See Authentication for scopes, revocation, and expiry.

Creating an API key in the dashboard
Creating a scoped key — the full key is shown exactly once.

2. Submit a generation

Generations are asynchronous. Create one by POSTing to POST /v1/generations with the model id and mode-specific parameters:

Create a generationbash
curl -X POST https://free.ind.in/v1/generations \
  -H "Authorization: Bearer fi_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "workspaceId": "00000000-0000-4000-8000-000000000000",
    "modelId": "00000000-0000-4000-8000-000000000001",
    "params": { "mode": "text_to_image", "prompt": "a red fox in snow" }
  }'

The response returns the generation record with a status of queued. To retry safely in automation, add an Idempotency-Key header — the same key returns the same generation instead of a duplicate.

The generation studio with a prompt typed and the estimated cost
The studio with a prompt — the estimated cost updates as you pick a model.

3. Poll for completion

Jobs move through queued → reserved → submitted → running → succeeded (or failed / cancelled / expired). Fetch the detail — it includes an events timeline and, on success, the generated output asset ids:

Poll generation detailbash
curl "https://free.ind.in/v1/generations/<generation-id>?workspaceId=<workspace-id>" \
  -H "Authorization: Bearer fi_live_..."

Prefer webhooks over polling in production. See Webhooks for signed terminal-state delivery.

A succeeded generation with the output preview and event timeline
On success the detail page shows the output preview, credits charged, and the event timeline.

4. Download outputs

Each asset has a download endpoint that returns a short-lived presigned URL:

Get a signed download URLbash
curl "https://free.ind.in/v1/assets/<asset-id>/download?workspaceId=<workspace-id>" \
  -H "Authorization: Bearer fi_live_..."

Redirect the client to the returned URL — do not proxy media through your server.

The generated fox image in the asset library
Finished outputs land in the library alongside your other assets.

Next steps

Uploads for image/video input modes

For image-to-image, image-to-video, and video-to-video modes, pass the source file in the generation inputs: upload it with POST /v1/files/upload-url + POST /v1/files/upload-complete and use the asset ids, or skip the upload and pass a public http(s) URL / base64 data URL in inputs.imageUrls / inputs.videoUrls. Full recipes are in Code examples.

Paying

By default generations bill plan credits. Pass "paymentMode": "wallet" to use the pay-as-you-go wallet instead — see Billing & wallet.

Cookies keep FreeInd working. Optional analytics require your permission. Read our cookie policy.