---
agent:
  instructions: "Search the site by keyword or question. The search API returns Markdown."
  endpoint: "https://platform.invideo.io/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Nano Banana Lite API

Model id: `nanobanana-lite` · Google · Image

## invideo API

Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /v1/request` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/v1/request' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "mode": "generate",
    "input": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"mode\":\"generate\",\"input\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/v1/request", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","mode":"generate","input":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription.

`cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "status": "succeeded",
  "output": {
    "files": [
      {
        "url": "https://…/completed-output"
      }
    ]
  },
  "cost_usd": "0.024",
  "cost": {
    "total_usd": "0.024",
    "lines": [
      {
        "item": "image",
        "quantity": "1",
        "unit_price_usd": "0.024",
        "amount_usd": "0.024"
      }
    ]
  }
}
```

## Adobe Firefly

Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /adobe/v3/images/generate-async` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/adobe/v3/images/generate-async' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/adobe/v3/images/generate-async", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/adobe/v3/images/generate-async", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns a task. Read `GET /adobe/v3/status/{id}` for the result.

`metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "metadata": {
    "invideo_cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Alibaba Model Studio

Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /dashscope/api/v1/services/aigc/text2image/image-synthesis` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -H 'x-dashscope-async: enable' \
  --data-binary '{
    "model": "nanobanana-lite",
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()}
response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json",
  "x-dashscope-async": "enable"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result.

`metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "metadata": {
    "invideo_cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Black Forest Labs

Set the base URL to `https://platform-api.invideo.io/bfl`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /bfl/v1/nanobanana-lite` · Model ID in `URL model segment`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/bfl/v1/nanobanana-lite' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/bfl/v1/nanobanana-lite", headers=headers, json=json.loads("{\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/bfl/v1/nanobanana-lite", {
  method: "POST", headers, body: JSON.stringify({"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns a polling URL for the result. When `status` is `Ready`, read `result.sample` for the image URL.

`metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "status": "Ready",
  "result": {
    "sample": "https://…/completed-output"
  },
  "metadata": {
    "invideo_cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## BytePlus ModelArk

Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /byteplus/api/v3/images/generations` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/images/generations' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/images/generations", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/images/generations", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns the completed images in the provider's response format. The response contains image URLs in `data[].url`.

`usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "data": [
    {
      "url": "https://…/completed-output"
    }
  ],
  "usage": {
    "cost": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## BytePlus Vision

Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns a task ID. Poll CVSync2AsyncGetResult for the result.

`metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "metadata": {
    "invideo_cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## fal

Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication.

Endpoint `POST /fal/nanobanana-lite` · Model ID in `URL model segment`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/fal/nanobanana-lite' \
  -H "Authorization: Key $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
  }'
```

### fal · JavaScript

```js
const response = await fetch("https://platform-api.invideo.io/fal/nanobanana-lite", {
  method: "POST",
  redirect: "error",
  headers: {
    Authorization: `Key ${process.env.INVIDEO_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/fal/nanobanana-lite", headers=headers, json=json.loads("{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}"), timeout=120)
response.raise_for_status()
print(response.text)
```

a queue request: read status_url until COMPLETED, then response_url for the result.

`usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "usage": {
    "cost": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Gemini

Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication.

Endpoint `POST /v1beta/models/nanobanana-lite:generateContent` · Model ID in `URL model segment`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/v1beta/models/nanobanana-lite:generateContent' \
  -H "x-goog-api-key: $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "contents": [
      {
        "parts": [
          {
            "text": "A blue ceramic vase on a plain cream background, soft studio light."
          }
        ]
      }
    ],
    "generationConfig": {
      "responseModalities": [
        "IMAGE"
      ]
    }
  }'
```

### Google GenAI SDK · Python

```python
import os
from google import genai
from google.genai import types

client = genai.Client(api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"})
response = client.models.generate_content(
    model="nanobanana-lite",
    contents="A blue ceramic vase on a plain cream background, soft studio light.",
    config=types.GenerateContentConfig(response_modalities=["IMAGE"]),
)
image = response.candidates[0].content.parts[0].inline_data.data
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "x-goog-api-key": "$INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/v1beta/models/nanobanana-lite:generateContent", {
  method: "POST", headers, body: JSON.stringify({"contents":[{"parts":[{"text":"A blue ceramic vase on a plain cream background, soft studio light."}]}],"generationConfig":{"responseModalities":["IMAGE"]}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

`candidates[0].content.parts[0].inlineData`, the image as base64, when the run ends. Read media bytes and the MIME type in `candidates[0].content.parts[].inlineData`.

`usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "usageMetadata": {
    "cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Higgsfield

Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /higgsfield/v1/text2image/soul` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/text2image/soul' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/higgsfield/v1/text2image/soul", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/text2image/soul", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion.

`metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "metadata": {
    "invideo_cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Ideogram

Set the base URL to `https://platform-api.invideo.io/ideogram`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /ideogram/generate` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/ideogram/generate' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/ideogram/generate", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/ideogram/generate", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns the completed images in the provider's response format. The response contains the generated image URLs in `data[].url`.

`metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "data": [
    {
      "url": "https://…/completed-output"
    }
  ],
  "metadata": {
    "invideo_cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Kling

Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /kling/v1/images/generations` · Model ID in `model_name`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/kling/v1/images/generations' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model_name": "nanobanana-lite",
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/kling/v1/images/generations", headers=headers, json=json.loads("{\"model_name\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/kling/v1/images/generations", {
  method: "POST", headers, body: JSON.stringify({"model_name":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns a task. Read `GET /kling/v1/images/generations/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs.

`metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "data": {
    "task_status": "succeed",
    "task_result": {
      "videos": [
        {
          "url": "https://…/completed-output"
        }
      ]
    }
  },
  "metadata": {
    "invideo_cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Luma

Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /luma/dream-machine/v1/generations/image` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations/image' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/luma/dream-machine/v1/generations/image", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations/image", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns a task. Read `GET /luma/dream-machine/v1/generations/{id}` for the result. The completed generation contains the file URL in `assets`.

`metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "state": "completed",
  "assets": {
    "image": "https://…/completed-output"
  },
  "metadata": {
    "invideo_cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Magnific

Set the base URL to `https://platform-api.invideo.io/freepik`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /freepik/v1/ai/image-upscaler` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/freepik/v1/ai/image-upscaler' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/freepik/v1/ai/image-upscaler", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/freepik/v1/ai/image-upscaler", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns a task. Read `GET /freepik/v1/ai/image-upscaler/{id}` for the result.

`data.cost_usd` on the completed task. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "data": {
    "cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## MiniMax

Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /minimax/v1/image_generation` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/minimax/v1/image_generation' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/minimax/v1/image_generation", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/minimax/v1/image_generation", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns the completed images in the provider's response format.

`metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "metadata": {
    "invideo_cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## OpenAI

Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /v1/images/generations` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/v1/images/generations' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
  }'
```

### OpenAI SDK · Python

```python
import os
from openai import OpenAI

client = OpenAI(api_key=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/v1")
result = client.images.generate(model="nanobanana-lite", prompt="A blue ceramic vase on a plain cream background, soft studio light.")
print(result.data[0].b64_json[:60])
```

### OpenAI SDK · JavaScript

```js
import OpenAI from "openai";

const client = new OpenAI({ apiKey: process.env.INVIDEO_API_KEY, baseURL: "https://platform-api.invideo.io/v1" });
const result = await client.images.generate({ model: "nanobanana-lite", prompt: "A blue ceramic vase on a plain cream background, soft studio light." });
console.log(result.data[0].b64_json.slice(0, 60));
```

the image as `b64_json` in `data[0]`, when the run ends.

`usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "data": [
    {
      "url": "https://…/completed-output"
    }
  ],
  "usage": {
    "cost": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Phota Labs

Set the base URL to `https://platform-api.invideo.io/phota`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /phota/v2/phota/generate` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/phota/v2/phota/generate' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "async": true,
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/phota/v2/phota/generate", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"async\":true,\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/phota/v2/phota/generate", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","async":true,"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns a job ID for polling. The completed job contains `result.download_urls`.

`metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "metadata": {
    "invideo_cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Pruna AI

Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -H 'model: nanobanana-lite' \
  --data-binary '{
    "input": {},
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"nanobanana-lite\"}").items()}
response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json",
  "model": "nanobanana-lite"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", {
  method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result.

`metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "metadata": {
    "invideo_cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Recraft

Set the base URL to `https://platform-api.invideo.io/recraft`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /recraft/v1/images/generations` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/recraft/v1/images/generations' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/recraft/v1/images/generations", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/recraft/v1/images/generations", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns the completed images in the provider's response format. Read the image URL in `data[].url` or the encoded bytes in `data[].b64_json`.

`usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "data": [
    {
      "url": "https://…/completed-output"
    }
  ],
  "usage": {
    "cost": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Replicate

Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /replicate/v1/models/invideo/nanobanana-lite/predictions` · Model ID in `URL model segment`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/nanobanana-lite/predictions' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "input": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### Replicate client · Python

```python
import os, replicate

client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate")
output = client.run("invideo/nanobanana-lite", input={
    "prompt": "A blue ceramic vase on a plain cream background, soft studio light.",
})
print(output)
```

### Replicate client · JavaScript

```js
import Replicate from "replicate";

const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" });
const output = await replicate.run("invideo/nanobanana-lite", { input: {
  "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
} });
console.log(output);
```

a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs.

`metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "status": "succeeded",
  "output": [
    "https://…/completed-output"
  ],
  "metrics": {
    "cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Reve

Set the base URL to `https://platform-api.invideo.io/reve`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /reve/v1/image/create` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/reve/v1/image/create' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/reve/v1/image/create", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/reve/v1/image/create", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns the completed images in the provider's response format.

`metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "metadata": {
    "invideo_cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Runware

Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /runware/v1` · Model ID in `task.model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/runware/v1' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '[
    {
      "taskType": "imageInference",
      "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'",
      "model": "nanobanana-lite",
      "deliveryMethod": "async",
      "extra": {
        "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
      }
    }
  ]'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"imageInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"nanobanana-lite\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}]"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/runware/v1", {
  method: "POST", headers, body: JSON.stringify([{"taskType":"imageInference","taskUUID":randomUUID(),"model":"nanobanana-lite","deliveryMethod":"async","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}]),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns a task UUID. Send getResponse using this UUID.

`usage.cost` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "usage": {
    "cost": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Runway

Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /runway/v1/text_to_image` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_image' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -H 'X-Runway-Version: 2024-11-06' \
  --data-binary '{
    "model": "nanobanana-lite",
    "ratio": "1280:720",
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### Runway SDK · Python

```python
import json
import os
import httpx
from runwayml import RunwayML

client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"])
result = client.post(
    "/v1/text_to_image",
    cast_to=httpx.Response,
    body=json.loads("{\"model\":\"nanobanana-lite\",\"ratio\":\"1280:720\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"),
)
print(result.json())
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json",
  "X-Runway-Version": "2024-11-06"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_image", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","ratio":"1280:720","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns a task. Read `GET /runway/v1/tasks/{id}` for the result. Read the output URLs in `output[]` after the task succeeds.

`metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "status": "SUCCEEDED",
  "output": [
    "https://…/completed-output"
  ],
  "metadata": {
    "invideo_cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## Topaz

Set the base URL to `https://platform-api.invideo.io/topaz`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /topaz/image/v1/enhance-gen/async` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "extra": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns a task. Read `GET /topaz/image/v1/status/{id}` for the result.

`metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "metadata": {
    "invideo_cost_usd": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## xAI

Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication.

Endpoint `POST /xai/v1/images/generations` · Model ID in `model`.

### curl

```bash
curl -X POST 'https://platform-api.invideo.io/xai/v1/images/generations' \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary '{
    "model": "nanobanana-lite",
    "extra_body": {
      "prompt": "A blue ceramic vase on a plain cream background, soft studio light."
    }
  }'
```

### HTTP · Python

```python
import json
import os
from pathlib import Path
from uuid import uuid4

import requests

headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"])
           for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()}
response = requests.post("https://platform-api.invideo.io/xai/v1/images/generations", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra_body\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120)
response.raise_for_status()
print(response.text)
```

### HTTP · JavaScript

```js
import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";

const headers = Object.fromEntries(Object.entries({
  "Authorization": "Bearer $INVIDEO_API_KEY",
  "Content-Type": "application/json"
})
  .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)]));

const response = await fetch("https://platform-api.invideo.io/xai/v1/images/generations", {
  method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra_body":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Returns the completed images in the provider's response format. The image is returned in `data[]`.

`usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "data": [
    {
      "url": "https://…/completed-output"
    }
  ],
  "usage": {
    "cost": "0.024",
    "invideo_cost": {
      "total_usd": "0.024",
      "lines": [
        {
          "item": "image",
          "quantity": "1",
          "unit_price_usd": "0.024",
          "amount_usd": "0.024"
        }
      ]
    }
  }
}
```

## invideo API input

The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB.

| Key | Type | Required | Default | Allowed | Description |
| --- | --- | --- | --- | --- | --- |
| `prompt` | string | yes | - | up to 30,000 characters | Prompt |
| `reference_image_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 14 files; PNG, JPEG or WebP | Reference images |
| `aspect_ratio` | string | no | `"16:9"` | `"1:1"`, `"2:3"`, `"3:2"`, `"3:4"`, `"4:3"`, `"4:5"`, `"5:4"`, `"9:16"`, `"16:9"`, `"21:9"` | Aspect ratio |
| `thinking` | string | no | `"minimal"` | `"minimal"`, `"high"` | Thinking |
| `output_mime_type` | string | no | `"image/png"` | `"image/png"`, `"image/jpeg"` | Output format |

## Output

### Submit answers

```json
{
  "id": "0f8b6c1e-0000-0000-0000-000000000000",
  "status": "queued"
}
```

### A finished request

```json
{
  "id": "0f8b6c1e-0000-0000-0000-000000000000",
  "model": "nanobanana-lite",
  "mode": "generate",
  "status": "succeeded",
  "created_at": "2026-01-01T10:00:00Z",
  "started_at": "2026-01-01T10:00:02Z",
  "finished_at": "2026-01-01T10:01:00Z",
  "output": {
    "kind": "image",
    "files": [
      {
        "url": "https://… (valid for 1 hour)",
        "content_type": "image/png",
        "size_bytes": 1048576,
        "width": 1280,
        "height": 720,
        "duration": null
      }
    ]
  },
  "error": null,
  "cost_usd": "0.25"
}
```

`status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`.

## Request and response logs

Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them.

### Read the response log (curl)

```bash
curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \
  -H "Authorization: Bearer $INVIDEO_API_KEY"
```

### A response log

```json
{
  "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7",
  "model": "<model-id>",
  "mode": "generate",
  "created_at": "2026-11-26T15:47:01.022556Z",
  "finished_at": "2026-11-26T15:47:09.350578Z",
  "cost_usd": "0.193248",
  "error": null,
  "output": {
    "files": [
      {
        "name": "1.mp3",
        "url": "https://…/1.mp3?X-Amz-Expires=3600&…",
        "download_url": "https://…/1.mp3?response-content-disposition=attachment…",
        "content_type": "audio/mpeg",
        "size_bytes": 1440620,
        "duration": 60.024,
        "width": null,
        "height": null
      }
    ]
  }
}
```

## Errors

A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead.

| HTTP | error | When |
| --- | --- | --- |
| 400 | - | The body is not valid JSON. |
| 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. |
| 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. |
| 404 | `not_found` | No request with this id (on a read). |
| 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. |
| 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. |
| 422 | `model_not_priced` | These options have no price yet, so they cannot run. |
| 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. |
| 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. |
| 500 | `server_error` | Something went wrong on our end. Please try again. |

## Price

From $0.0336 / image.

| Mode and options | Unit rate (USD) |
| --- | --- |
| Generate | $0.0336 / image |
| Generate · Input tokens | $0.0003 / request (typical) |
