> ## Documentation Index
> Fetch the complete documentation index at: https://www.krea.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Krea API introduction

> Generate images and videos with the Krea API, including ByteDance Seedance 2.5 and Krea models. Get API keys, REST endpoints, SDK examples, and pricing.

The Krea API provides programmatic access to AI image and video generation through `https://api.krea.ai`. Use ByteDance's [Seedance API on Krea](https://www.krea.ai/docs/developers/seedance.md) for text-to-video, image-to-video, and reference-guided video generation. The same Krea API token also works with the other models listed in the [API reference](https://www.krea.ai/docs/api-reference/introduction.md).![Model with platinum windswept hair, orange-tinted goggles and a black wool coat, made with Krea 3](https://optim-images.krea.ai/https---s-krea-ai-k3-landing-final-hero-windcoat-base-webp-2048.webp)# [Krea 3](https://www.krea.ai/docs/developers/krea-3/overview.md)Our new image editing model. Describe the change in plain language — most edits come back in under 8 seconds at native 2K.Get started> [!NOTE]
>
> **Before you start**, generate an API token at [krea.ai/settings/api-tokens](https://www.krea.ai/settings/api-tokens). See [API Keys & Billing](https://www.krea.ai/docs/developers/api-keys-and-billing.md) for help.Use the Krea APIProgrammatic access to Krea's image and video models.[Open](https://www.krea.ai/features/api)## Popular ModelsPick a model below for a quick start, or browse all available endpoints in [Model APIs](https://www.krea.ai/docs/api-reference/introduction.md).### Image Generation

\\<details>

\\<summary>krea
            
          
        Krea 3 — our newest image model</summary>
      Provider

Krea

Type

image

Pricing

From \\\\$0.03

Estimated Time

Most edits under 8 seconds

Endpoint

\\`/generate/image/krea/krea-3`

Generate from text or edit with image references. Base pricing is \\\\$0.03 at 1K or \\\\$0.06 at 2K, with additional charges for references and `high` thinking mode. The `fast` and `high` thinking modes are available on every workspace. See the [Krea 3 API overview](https://www.krea.ai/docs/developers/krea-3/overview.md) for parameters, pricing, and editing examples.

\\**Example Usage:**

\\```javascript Node.js theme={"theme":{"light":"github-light-default","dark":"vesper"}}
// npm install @krea-ai/sdk
import { Krea } from "@krea-ai/sdk";

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

const result = await krea.subscribe("image/krea/krea-3", {
  input: {
    prompt: "A cinematic product photo of a glass lamp on a marble table",
    aspect_ratio: "16:9",
    resolution: "2K",
    thinking_mode: "fast"
  },
});

console.log(result.data?.urls[0]);
\\```

\\```bash cURL theme={"theme":{"light":"github-light-default","dark":"vesper"}}
curl -X POST https://api.krea.ai/generate/image/krea/krea-3 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A cinematic product photo of a glass lamp on a marble table",
    "aspect_ratio": "16:9",
    "resolution": "2K",
    "thinking_mode": "fast"
  }'
\\```

\\```python Python theme={"theme":{"light":"github-light-default","dark":"vesper"}}
import requests

API_BASE = "https://api.krea.ai"
API_TOKEN = "your-token-secret"

response = requests.post(
    f"{API_BASE}/generate/image/krea/krea-3",
    headers={
        "Authorization": f"Bearer {API_TOKEN}",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "A cinematic product photo of a glass lamp on a marble table",
        "aspect_ratio": "16:9",
        "resolution": "2K",
        "thinking_mode": "fast"
    }
)

job = response.json()
print(f"Job ID: {job['job_id']}")
\\```

\\```go Go theme={"theme":{"light":"github-light-default","dark":"vesper"}}
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    apiBase := "https://api.krea.ai"
    apiToken := "your-token-secret"

    payload := map[string]interface{}{
        "prompt":        "A cinematic product photo of a glass lamp on a marble table",
        "aspect_ratio":  "16:9",
        "resolution":    "2K",
        "thinking_mode": "fast",
    }

    jsonData, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", apiBase+"/generate/image/krea/krea-3", bytes.NewBuffer(jsonData))
    req.Header.Set("Authorization", "Bearer "+apiToken)
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    var job map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&job)
    fmt.Printf("Job ID: %s\n", job["job_id"])
}
\\```

Poll `GET /jobs/{job_id}` from the response until the job completes, then read `result.urls[0]`.

\\</details>



\\<details>

\\<summary>deepmind
            
          
        Nano Banana Pro - Superior typography and photorealistic detail</summary>
      Provider

Google

Type

image

Pricing

From \\\\$0.15

Estimated Time

\\\\~24 seconds

Endpoint

\\`/generate/image/google/nano-banana-pro`

\\**Example Usage:**

\\```javascript Node.js theme={"theme":{"light":"github-light-default","dark":"vesper"}}
// 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("google/nano-banana-pro", {
  prompt: "a futuristic cityscape with neon lights at night, in the style of a graphic novel",
  aspect_ratio: "1:1",
  resolution: "1K"
});

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

\\```bash cURL theme={"theme":{"light":"github-light-default","dark":"vesper"}}
curl -X POST https://api.krea.ai/generate/image/google/nano-banana-pro \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a futuristic cityscape with neon lights at night, in the style of a graphic novel",
    "aspect_ratio": "1:1",
    "resolution": "1K"
  }'
\\```

\\```python Python theme={"theme":{"light":"github-light-default","dark":"vesper"}}
import requests

API_BASE = "https://api.krea.ai"
API_TOKEN = "your-token-secret"

response = requests.post(
    f"{API_BASE}/generate/image/google/nano-banana-pro",
    headers={
        "Authorization": f"Bearer {API_TOKEN}",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "a futuristic cityscape with neon lights at night, in the style of a graphic novel",
        "aspect_ratio": "1:1",
        "resolution": "1K"
    }
)

job = response.json()
print(f"Job ID: {job['job_id']}")
\\```

\\```go Go theme={"theme":{"light":"github-light-default","dark":"vesper"}}
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    apiBase := "https://api.krea.ai"
    apiToken := "your-token-secret"

    payload := map[string]interface{}{
        "prompt": "a futuristic cityscape with neon lights at night, in the style of a graphic novel",
        "aspect_ratio": "1:1",
        "resolution": "1K",
    }

    jsonData, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", apiBase+"/generate/image/google/nano-banana-pro", bytes.NewBuffer(jsonData))
    req.Header.Set("Authorization", "Bearer "+apiToken)
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    var job map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&job)
    fmt.Printf("Job ID: %s\n", job["job_id"])
}
\\```

\\</details>



\\<details>

\\<summary>bytedance
            
          
        Seedream 4 - High quality model for photorealism and text rendering</summary>
      Provider

ByteDance

Type

image

Pricing

\\\\$0.0315

Estimated Time

\\\\~20 seconds

Endpoint

\\`/generate/image/bytedance/seedream-4`

\\**Example Usage:**

\\```javascript Node.js theme={"theme":{"light":"github-light-default","dark":"vesper"}}
// 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("bytedance/seedream-4", {
  prompt: "a photorealistic portrait of a person reading in a cozy library",
  width: 1024,
  height: 1024
});

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

\\```bash cURL theme={"theme":{"light":"github-light-default","dark":"vesper"}}
curl -X POST https://api.krea.ai/generate/image/bytedance/seedream-4 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a photorealistic portrait of a person reading in a cozy library",
    "width": 1024,
    "height": 1024
  }'
\\```

\\```python Python theme={"theme":{"light":"github-light-default","dark":"vesper"}}
import requests

API_BASE = "https://api.krea.ai"
API_TOKEN = "your-token-secret"

response = requests.post(
    f"{API_BASE}/generate/image/bytedance/seedream-4",
    headers={
        "Authorization": f"Bearer {API_TOKEN}",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "a photorealistic portrait of a person reading in a cozy library",
        "width": 1024,
        "height": 1024
    }
)

job = response.json()
print(f"Job ID: {job['job_id']}")
\\```

\\```go Go theme={"theme":{"light":"github-light-default","dark":"vesper"}}
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    apiBase := "https://api.krea.ai"
    apiToken := "your-token-secret"

    payload := map[string]interface{}{
        "prompt": "a photorealistic portrait of a person reading in a cozy library",
        "width": 1024,
        "height": 1024,
    }

    jsonData, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", apiBase+"/generate/image/bytedance/seedream-4", bytes.NewBuffer(jsonData))
    req.Header.Set("Authorization", "Bearer "+apiToken)
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    var job map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&job)
    fmt.Printf("Job ID: %s\n", job["job_id"])
}
\\```

\\</details>



\\<details>

\\<summary>openai
            
          
        GPT Image 2 - High quality generation and editing with strong prompt adherence</summary>
      Provider

OpenAI

Type

image

Pricing

From \\\\$0.009

Estimated Time

\\\\~55 seconds

Endpoint

\\`/generate/image/openai/gpt-image-2`

\\**Example Usage:**

\\```javascript Node.js theme={"theme":{"light":"github-light-default","dark":"vesper"}}
// 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("openai/gpt-image-2", {
  prompt: "an intricate steampunk airship flying through clouds at golden hour",
  aspect_ratio: "1:1",
  resolution: "1K"
});

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

\\```bash cURL theme={"theme":{"light":"github-light-default","dark":"vesper"}}
curl -X POST https://api.krea.ai/generate/image/openai/gpt-image-2 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "an intricate steampunk airship flying through clouds at golden hour",
    "aspect_ratio": "1:1",
    "resolution": "1K"
  }'
\\```

\\```python Python theme={"theme":{"light":"github-light-default","dark":"vesper"}}
import requests

API_BASE = "https://api.krea.ai"
API_TOKEN = "your-token-secret"

response = requests.post(
    f"{API_BASE}/generate/image/openai/gpt-image-2",
    headers={
        "Authorization": f"Bearer {API_TOKEN}",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "an intricate steampunk airship flying through clouds at golden hour",
        "aspect_ratio": "1:1",
        "resolution": "1K"
    }
)

job = response.json()
print(f"Job ID: {job['job_id']}")
\\```

\\```go Go theme={"theme":{"light":"github-light-default","dark":"vesper"}}
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    apiBase := "https://api.krea.ai"
    apiToken := "your-token-secret"

    payload := map[string]interface{}{
        "prompt": "an intricate steampunk airship flying through clouds at golden hour",
        "aspect_ratio": "1:1",
        "resolution": "1K",
    }

    jsonData, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", apiBase+"/generate/image/openai/gpt-image-2", bytes.NewBuffer(jsonData))
    req.Header.Set("Authorization", "Bearer "+apiToken)
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    var job map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&job)
    fmt.Printf("Job ID: %s\n", job["job_id"])
}
\\```

\\</details>

### Video Generation

\\<details>

\\<summary>deepmind
            
          
        Veo 3.1 - Google's latest video generation model</summary>
      Provider

Google

Type

video

Pricing

From \\\\$0.20/sec

Estimated Time

\\\\~5 minutes

Endpoint

\\`/generate/video/google/veo-3.1`

\\**Example Usage:**

\\```javascript Node.js theme={"theme":{"light":"github-light-default","dark":"vesper"}}
// 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.video("google/veo-3.1", {
  prompt: "a time-lapse of a bustling city street from day to night",
  aspect_ratio: "16:9",
  duration: 6,
  resolution: "720p"
});

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

\\```bash cURL theme={"theme":{"light":"github-light-default","dark":"vesper"}}
curl -X POST https://api.krea.ai/generate/video/google/veo-3.1 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a time-lapse of a bustling city street from day to night",
    "aspect_ratio": "16:9",
    "duration": 6,
    "resolution": "720p"
  }'
\\```

\\```python Python theme={"theme":{"light":"github-light-default","dark":"vesper"}}
import requests

API_BASE = "https://api.krea.ai"
API_TOKEN = "your-token-secret"

response = requests.post(
    f"{API_BASE}/generate/video/google/veo-3.1",
    headers={
        "Authorization": f"Bearer {API_TOKEN}",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "a time-lapse of a bustling city street from day to night",
        "aspect_ratio": "16:9",
        "duration": 6,
        "resolution": "720p"
    }
)

job = response.json()
print(f"Job ID: {job['job_id']}")
\\```

\\```go Go theme={"theme":{"light":"github-light-default","dark":"vesper"}}
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    apiBase := "https://api.krea.ai"
    apiToken := "your-token-secret"

    payload := map[string]interface{}{
        "prompt": "a time-lapse of a bustling city street from day to night",
        "aspect_ratio": "16:9",
        "duration": 6,
        "resolution": "720p",
    }

    jsonData, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", apiBase+"/generate/video/google/veo-3.1", bytes.NewBuffer(jsonData))
    req.Header.Set("Authorization", "Bearer "+apiToken)
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    var job map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&job)
    fmt.Printf("Job ID: %s\n", job["job_id"])
}
\\```

\\</details>



\\<details>

\\<summary>kling
            
          
        Kling 3.0 - Latest frontier model from Kling</summary>
      Provider

Kling

Type

video

Pricing

From \\\\$0.17/sec

Estimated Time

\\\\~3 minutes

Endpoint

\\`/generate/video/kling/kling-3.0`

\\**Example Usage:**

\\```javascript Node.js theme={"theme":{"light":"github-light-default","dark":"vesper"}}
// 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.video("kling/kling-3.0", {
  prompt: "a cinematic tracking shot through a lantern-lit market at night",
  aspect_ratio: "16:9",
  duration: 5,
  mode: "std"
});

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

\\```bash cURL theme={"theme":{"light":"github-light-default","dark":"vesper"}}
curl -X POST https://api.krea.ai/generate/video/kling/kling-3.0 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a cinematic tracking shot through a lantern-lit market at night",
    "aspect_ratio": "16:9",
    "duration": 5,
    "mode": "std"
  }'
\\```

\\```python Python theme={"theme":{"light":"github-light-default","dark":"vesper"}}
import requests

API_BASE = "https://api.krea.ai"
API_TOKEN = "your-token-secret"

response = requests.post(
    f"{API_BASE}/generate/video/kling/kling-3.0",
    headers={
        "Authorization": f"Bearer {API_TOKEN}",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "a cinematic tracking shot through a lantern-lit market at night",
        "aspect_ratio": "16:9",
        "duration": 5,
        "mode": "std"
    }
)

job = response.json()
print(f"Job ID: {job['job_id']}")
\\```

\\```go Go theme={"theme":{"light":"github-light-default","dark":"vesper"}}
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    apiBase := "https://api.krea.ai"
    apiToken := "your-token-secret"

    payload := map[string]interface{}{
        "prompt": "a cinematic tracking shot through a lantern-lit market at night",
        "aspect_ratio": "16:9",
        "duration": 5,
        "mode": "std",
    }

    jsonData, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", apiBase+"/generate/video/kling/kling-3.0", bytes.NewBuffer(jsonData))
    req.Header.Set("Authorization", "Bearer "+apiToken)
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    var job map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&job)
    fmt.Printf("Job ID: %s\n", job["job_id"])
}
\\```

\\</details>



\\<details>

\\<summary>qwen
            
          
        Wan 2.5 - Fast, high-quality model from Alibaba</summary>
      Provider

Alibaba

Type

video

Pricing

From \\\\$0.0525/sec

Estimated Time

\\\\~3 minutes

Endpoint

\\`/generate/video/alibaba/wan-2.5`

\\**Example Usage:**

\\```javascript Node.js theme={"theme":{"light":"github-light-default","dark":"vesper"}}
// 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.video("alibaba/wan-2.5", {
  prompt: "a drone flying over a tropical beach at sunset",
  duration: 5
});

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

\\```bash cURL theme={"theme":{"light":"github-light-default","dark":"vesper"}}
curl -X POST https://api.krea.ai/generate/video/alibaba/wan-2.5 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a drone flying over a tropical beach at sunset",
    "duration": 5
  }'
\\```

\\```python Python theme={"theme":{"light":"github-light-default","dark":"vesper"}}
import requests

API_BASE = "https://api.krea.ai"
API_TOKEN = "your-token-secret"

response = requests.post(
    f"{API_BASE}/generate/video/alibaba/wan-2.5",
    headers={
        "Authorization": f"Bearer {API_TOKEN}",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "a drone flying over a tropical beach at sunset",
        "duration": 5
    }
)

job = response.json()
print(f"Job ID: {job['job_id']}")
\\```

\\```go Go theme={"theme":{"light":"github-light-default","dark":"vesper"}}
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    apiBase := "https://api.krea.ai"
    apiToken := "your-token-secret"

    payload := map[string]interface{}{
        "prompt": "a drone flying over a tropical beach at sunset",
        "duration": 5,
    }

    jsonData, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", apiBase+"/generate/video/alibaba/wan-2.5", bytes.NewBuffer(jsonData))
    req.Header.Set("Authorization", "Bearer "+apiToken)
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    var job map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&job)
    fmt.Printf("Job ID: %s\n", job["job_id"])
}
\\```

\\</details>

## More ModelsFor a list of all available models, see the [Model APIs](https://www.krea.ai/docs/api-reference/introduction.md) page.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.