Skip to main content

Creating API Keys

Only workspace owners and admins can create API tokens. If you don’t see the option to create a token, contact your workspace owner to request access or an elevated role. To create an API key:
  1. Navigate to krea.ai/settings/api-tokens
  2. Make sure you’re in the correct workspace (using the workspace toggle on the top left)
  3. Click “New Token”
  4. Give your token a descriptive name
  5. Save the token securely—you’ll only see it once!
The API operates as its own user identity within your workspace. Styles trained in the app won’t be accessible via the API, and styles trained via the API won’t appear in the app, unless they are shared with the workspace. See Train a Custom Style for details.
Security Guidelines
  • Store tokens in environment variables, never in code
  • Use different tokens for development and production
  • Revoke tokens immediately if compromised
  • Never commit tokens to version control
  • Never share tokens publicly

Using API Keys

Include your token in the Authorization header of all requests:
// npm install @krea-ai/sdk
import { Krea } from "@krea-ai/sdk";

const krea = new Krea({ apiKey: process.env.KREA_API_KEY });

const job = await krea.image("bfl/flux-1-dev", {
  prompt: "a serene mountain landscape at sunset",
  width: 1024,
  height: 576
});

console.log(`Job ID: ${job.job_id}`);

Pricing

For per-model prices, see krea.ai/features/api ↗. Every model has a fixed per-generation price determined by your request parameters (resolution, quality, audio, duration, style references, etc.).

How API Billing Works

API and MCP usage draws from a separate USD balance on your workspace — independent from the compute units used by the Krea web app. API access must be enabled on your workspace before you can use API keys; if it isn’t, contact support@krea.ai ↗.
Failed and cancelled jobs are not billed. You only pay for completed jobs.

When your balance runs out

In-flight jobs finish normally. New API requests are rejected with HTTP 402 Payment Required:
{
  "message": "Your API balance is separate from your workspace compute balance. Please top up your API balance to continue using the API."
}
Top up at krea.ai/app/api/ to resume. There is no public endpoint for checking your balance programmatically — monitor it in-app.

Adding API Balance

Add funds at krea.ai/app/api/. Only workspace owners can add API balance.
  • Preset amounts: $10, $25, $50, $100
  • Custom amount: $5 minimum, $10,000 maximum
  • Paid via Stripe Checkout; balance applies immediately on success

Tracking Usage

Recent spend is shown on the API balance card at krea.ai/app/api/ under “API cost in the last 7 days.”

Enterprise

Higher-volume customers can be invoiced monthly on Net 30 terms instead of prepaying. Contact sales@krea.ai ↗ to discuss enterprise billing.

Next Steps

Interactive Playground

Make your first API request

Model APIs

Explore all available endpoints

Job Lifecycle

Understand job states and polling

Rate Limits

Understand API limits by plan tier