Krea 2 AI

Developer API

Krea2 API for your backend.

Submit Krea 2 image jobs, poll their status, and pay from the same credit balance used in the visual studio.

RESTJSONAsynchronousBearer auth
Base URLhttps://krea2.org/api/v1

Create an API key

Keys belong to your Krea2 account. Create separate secrets for production, staging, and local development; the full value is shown once.

Sign in before creating a key

Your Google account connects the secret to the same credit balance used by the visual generator.

Sign in securely

Create a generation

Keep the key on your server. A successful request returns HTTP 202 with the generation ID, credit charge, remaining balance, and estimated duration.

curl -X POST "https://krea2.org/api/v1/generations" \
  -H "Authorization: Bearer $KREA2_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: render_2026_07_18_001" \
  -d '{
    "model": "krea/v2/medium/text-to-image",
    "prompt": "Editorial photograph of a glass lamp on limestone",
    "aspect_ratio": "4:5",
    "creativity": "medium"
  }'

Idempotency: reuse the same key only when retrying the same logical generation. A different payload with the same key returns HTTP 409.

Endpoints

Three account-scoped endpoints cover submission, status polling, and balance checks.

POST/api/v1/generations

Submit work

Validates the model request, reserves credits transactionally, creates provider work, and returns the internal generation ID.

GET/api/v1/generations/:id

Poll status

Returns queued, processing, succeeded, or failed. A successful response includes the archived output URL.

GET/api/v1/credits

Read balance

Returns the balance after browser usage, API usage, purchases, subscription grants, and refunds.

One shared credit ledger

There is no separate API wallet. Requests that definitely did not start and provider-confirmed terminal failures follow the same refund path as a studio generation; uncertain outcomes remain held for reconciliation.

krea/v2/medium/turbo/text-to-imageKrea 2 Medium Turbo
1 credit / image
krea/v2/medium/text-to-imageKrea 2 Medium
2 credits / image
krea/v2/large/text-to-imageKrea 2 Large
4 credits / image

Retry without charging twice

The API is asynchronous. Persist the returned ID, poll with backoff, and use idempotency for safe retries.

  1. 01

    Authenticate

    Send the secret as a Bearer token from a trusted server. Revoked keys stop working immediately.

  2. 02

    Submit

    Add a unique Idempotency-Key. Replaying the same request returns the original generation instead of reserving credits again.

  3. 03

    Poll

    Use the returned ID with the status endpoint. Back off between requests instead of keeping one HTTP connection open.

  4. 04

    Store

    Persist the generation ID and final output URL. Assets use the same archive path as studio results.

Operational boundaries

Keys stay server-side
Do not embed a reusable key in browser JavaScript, a public mobile bundle, analytics, screenshots, or a repository.
Results stay account-scoped
A key can only read generations created by its account. Generation IDs do not grant cross-account access.
Clients handle rate limits
A 429 response means the client should back off before submitting more provider work.
Balance failures are explicit
HTTP 402 is returned before provider submission when the shared account balance cannot cover the selected model.

Krea2 API FAQ

Do API requests use a separate credit balance?+

No. The API key belongs to the same Krea2 account used by the browser studio. API generations, browser generations, purchases, subscription grants, and refunds all update one shared credit ledger.

When are credits deducted?+

Credits are reserved transactionally before provider work is submitted. If the generation cannot start or later fails, the existing automatic refund path returns the charge once.

How do I avoid duplicate charges when retrying?+

Send a unique Idempotency-Key with each logical generation. Repeating the same key and request returns the original generation; reusing the key with a different payload returns HTTP 409.

Can I put a Krea2 API key in browser code?+

No. Store it in an environment variable or secret manager and call the API from your server. Revoke any key that is exposed.

Which Krea 2 models are available?+

The initial API supports Krea 2 Medium Turbo, Medium, and Large text-to-image routes. Their current costs are 1, 2, and 4 credits per image.