---
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/"
---

# Gemini 4 Neon API

Model id: `gemini-4-neon` · Google · LLM

## Anthropic Messages

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

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

### curl

```bash
curl https://platform-api.invideo.io/v1/messages \
  -H "x-api-key: $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-4-neon",
  "max_tokens": 256,
  "messages": [
    {
      "role": "user",
      "content": "Explain why the sky looks blue in one sentence."
    }
  ]
}'
```

### Anthropic SDK · Python

```python
import anthropic, os

client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"])

answer = client.messages.create(
    model="gemini-4-neon",
    max_tokens=256,
    messages=[
        {
            "role": "user",
            "content": "Explain why the sky looks blue in one sentence.",
        },
    ],
)
print("".join(block.text for block in answer.content if block.type == "text"))
```

### HTTP · JavaScript

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

const headers = Object.fromEntries(Object.entries({
  "x-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/v1/messages", {
  method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Read the text blocks in `content[]` of the returned message.

`usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "Air scatters blue light more than red light."
    }
  ],
  "usage": {
    "input_tokens": 10,
    "output_tokens": 2,
    "cost_usd": "0.000002",
    "invideo_cost": {
      "total_usd": "0.000002",
      "lines": [
        {
          "item": "input_tokens",
          "quantity": "10",
          "unit_price_usd": "0.0000001",
          "amount_usd": "0.000001"
        },
        {
          "item": "output_tokens",
          "quantity": "2",
          "unit_price_usd": "0.0000005",
          "amount_usd": "0.000001"
        }
      ]
    }
  }
}
```

## BytePlus

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/chat/completions` · Model ID in `model`.

### curl

```bash
curl https://platform-api.invideo.io/byteplus/api/v3/chat/completions \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-4-neon",
  "messages": [
    {
      "role": "user",
      "content": "Explain why the sky looks blue in one sentence."
    }
  ]
}'
```

### BytePlus Ark SDK · Python

```python
import json
import os
from volcenginesdkarkruntime import Ark

client = Ark(base_url="https://platform-api.invideo.io/byteplus/api/v3", api_key=os.environ["INVIDEO_API_KEY"])
answer = client.chat.completions.create(**json.loads("{\"model\":\"gemini-4-neon\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}"))
print(answer.choices[0].message.content)
```

### 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/chat/completions", {
  method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Read `choices[0].message.content`. For streaming, read the deltas from the event stream.

`usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Air scatters blue light more than red light."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 2,
    "cost": "0.000002",
    "invideo_cost": {
      "total_usd": "0.000002",
      "lines": [
        {
          "item": "input_tokens",
          "quantity": "10",
          "unit_price_usd": "0.0000001",
          "amount_usd": "0.000001"
        },
        {
          "item": "output_tokens",
          "quantity": "2",
          "unit_price_usd": "0.0000005",
          "amount_usd": "0.000001"
        }
      ]
    }
  }
}
```

## DeepSeek

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

Endpoint `POST /deepseek/v1/chat/completions` · Model ID in `model`.

### curl

```bash
curl https://platform-api.invideo.io/deepseek/v1/chat/completions \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-4-neon",
  "messages": [
    {
      "role": "user",
      "content": "Explain why the sky looks blue in one sentence."
    }
  ]
}'
```

### OpenAI SDK · Python

```python
from openai import OpenAI
import os

client = OpenAI(base_url="https://platform-api.invideo.io/deepseek/v1", api_key=os.environ["INVIDEO_API_KEY"])

answer = client.chat.completions.create(
    model="gemini-4-neon",
    messages=[
        {
            "role": "user",
            "content": "Explain why the sky looks blue in one sentence.",
        },
    ],
)
print(answer.choices[0].message.content)
```

### 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/deepseek/v1/chat/completions", {
  method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Read `choices[0].message.content`. For streaming, read the deltas from the event stream.

`usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Air scatters blue light more than red light."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 2,
    "cost": "0.000002",
    "invideo_cost": {
      "total_usd": "0.000002",
      "lines": [
        {
          "item": "input_tokens",
          "quantity": "10",
          "unit_price_usd": "0.0000001",
          "amount_usd": "0.000001"
        },
        {
          "item": "output_tokens",
          "quantity": "2",
          "unit_price_usd": "0.0000005",
          "amount_usd": "0.000001"
        }
      ]
    }
  }
}
```

## 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/gemini-4-neon:generateContent` · Model ID in `URL model segment`.

### curl

```bash
curl https://platform-api.invideo.io/v1beta/models/gemini-4-neon:generateContent \
  -H "x-goog-api-key: $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Explain why the sky looks blue in one sentence."
        }
      ]
    }
  ],
  "generationConfig": {}
}'
```

### Google GenAI SDK · Python

```python
from google import genai
import os

client = genai.Client(
    api_key=os.environ["INVIDEO_API_KEY"],
    http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"},
)

answer = client.models.generate_content(
    model="gemini-4-neon",
    contents=[
        {
            "role": "user",
            "parts": [
                {
                    "text": "Explain why the sky looks blue in one sentence.",
                },
            ],
        },
    ],
)
print(answer.text)
```

### 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/gemini-4-neon:generateContent", {
  method: "POST", headers, body: JSON.stringify({"contents":[{"role":"user","parts":[{"text":"Explain why the sky looks blue in one sentence."}]}],"generationConfig":{}}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Read the text from `candidates[0].content.parts[]`.

`usageMetadata.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {
            "text": "Air scatters blue light more than red light."
          }
        ]
      },
      "finishReason": "STOP"
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 10,
    "candidatesTokenCount": 2,
    "cost_usd": "0.000002",
    "invideo_cost": {
      "total_usd": "0.000002",
      "lines": [
        {
          "item": "input_tokens",
          "quantity": "10",
          "unit_price_usd": "0.0000001",
          "amount_usd": "0.000001"
        },
        {
          "item": "output_tokens",
          "quantity": "2",
          "unit_price_usd": "0.0000005",
          "amount_usd": "0.000001"
        }
      ]
    }
  }
}
```

## MiniMax

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

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

### curl

```bash
curl https://platform-api.invideo.io/minimax/anthropic/v1/messages \
  -H "x-api-key: $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-4-neon",
  "max_tokens": 256,
  "messages": [
    {
      "role": "user",
      "content": "Explain why the sky looks blue in one sentence."
    }
  ]
}'
```

### Anthropic SDK · Python

```python
import anthropic, os

client = anthropic.Anthropic(base_url="https://platform-api.invideo.io/minimax/anthropic", api_key=os.environ["INVIDEO_API_KEY"])

answer = client.messages.create(
    model="gemini-4-neon",
    max_tokens=256,
    messages=[
        {
            "role": "user",
            "content": "Explain why the sky looks blue in one sentence.",
        },
    ],
)
print("".join(block.text for block in answer.content if block.type == "text"))
```

### HTTP · JavaScript

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

const headers = Object.fromEntries(Object.entries({
  "x-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/minimax/anthropic/v1/messages", {
  method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Read the text blocks in `content[]` of the returned message.

`usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "Air scatters blue light more than red light."
    }
  ],
  "usage": {
    "input_tokens": 10,
    "output_tokens": 2,
    "cost_usd": "0.000002",
    "invideo_cost": {
      "total_usd": "0.000002",
      "lines": [
        {
          "item": "input_tokens",
          "quantity": "10",
          "unit_price_usd": "0.0000001",
          "amount_usd": "0.000001"
        },
        {
          "item": "output_tokens",
          "quantity": "2",
          "unit_price_usd": "0.0000005",
          "amount_usd": "0.000001"
        }
      ]
    }
  }
}
```

## Moonshot AI

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

Endpoint `POST /moonshot/v1/chat/completions` · Model ID in `model`.

### curl

```bash
curl https://platform-api.invideo.io/moonshot/v1/chat/completions \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-4-neon",
  "messages": [
    {
      "role": "user",
      "content": "Explain why the sky looks blue in one sentence."
    }
  ]
}'
```

### OpenAI SDK · Python

```python
from openai import OpenAI
import os

client = OpenAI(base_url="https://platform-api.invideo.io/moonshot/v1", api_key=os.environ["INVIDEO_API_KEY"])

answer = client.chat.completions.create(
    model="gemini-4-neon",
    messages=[
        {
            "role": "user",
            "content": "Explain why the sky looks blue in one sentence.",
        },
    ],
)
print(answer.choices[0].message.content)
```

### 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/moonshot/v1/chat/completions", {
  method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Read `choices[0].message.content`. For streaming, read the deltas from the event stream.

`usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Air scatters blue light more than red light."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 2,
    "cost": "0.000002",
    "invideo_cost": {
      "total_usd": "0.000002",
      "lines": [
        {
          "item": "input_tokens",
          "quantity": "10",
          "unit_price_usd": "0.0000001",
          "amount_usd": "0.000001"
        },
        {
          "item": "output_tokens",
          "quantity": "2",
          "unit_price_usd": "0.0000005",
          "amount_usd": "0.000001"
        }
      ]
    }
  }
}
```

## OpenAI Chat

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

Endpoint `POST /v1/chat/completions` · Model ID in `model`.

### curl

```bash
curl https://platform-api.invideo.io/v1/chat/completions \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-4-neon",
  "messages": [
    {
      "role": "user",
      "content": "Explain why the sky looks blue in one sentence."
    }
  ]
}'
```

### OpenAI SDK · Python

```python
from openai import OpenAI
import os

client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"])

answer = client.chat.completions.create(
    model="gemini-4-neon",
    messages=[
        {
            "role": "user",
            "content": "Explain why the sky looks blue in one sentence.",
        },
    ],
)
print(answer.choices[0].message.content)
```

### 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/chat/completions", {
  method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Read `choices[0].message.content`. For streaming, read the deltas from the event stream.

`usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Air scatters blue light more than red light."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 2,
    "cost": "0.000002",
    "invideo_cost": {
      "total_usd": "0.000002",
      "lines": [
        {
          "item": "input_tokens",
          "quantity": "10",
          "unit_price_usd": "0.0000001",
          "amount_usd": "0.000001"
        },
        {
          "item": "output_tokens",
          "quantity": "2",
          "unit_price_usd": "0.0000005",
          "amount_usd": "0.000001"
        }
      ]
    }
  }
}
```

## OpenAI Responses

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

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

### curl

```bash
curl https://platform-api.invideo.io/v1/responses \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-4-neon",
  "input": [
    {
      "role": "user",
      "content": "Explain why the sky looks blue in one sentence."
    }
  ]
}'
```

### OpenAI SDK · Python

```python
from openai import OpenAI
import os

client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"])

answer = client.responses.create(
    model="gemini-4-neon",
    input=[
        {
            "role": "user",
            "content": "Explain why the sky looks blue in one sentence.",
        },
    ],
)
print(answer.output_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/responses", {
  method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","input":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Read text items in `output[].content[]`. SDKs expose the combined text as `output_text`.

`usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "object": "response",
  "status": "completed",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Air scatters blue light more than red light."
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 10,
    "output_tokens": 2,
    "cost_usd": "0.000002",
    "invideo_cost": {
      "total_usd": "0.000002",
      "lines": [
        {
          "item": "input_tokens",
          "quantity": "10",
          "unit_price_usd": "0.0000001",
          "amount_usd": "0.000001"
        },
        {
          "item": "output_tokens",
          "quantity": "2",
          "unit_price_usd": "0.0000005",
          "amount_usd": "0.000001"
        }
      ]
    },
    "cost": "0.000002"
  }
}
```

## OpenRouter

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

Endpoint `POST /openrouter/api/v1/chat/completions` · Model ID in `model`.

### curl

```bash
curl https://platform-api.invideo.io/openrouter/api/v1/chat/completions \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-4-neon",
  "messages": [
    {
      "role": "user",
      "content": "Explain why the sky looks blue in one sentence."
    }
  ]
}'
```

### OpenRouter SDK · Python

```python
import json
import os
from openrouter import OpenRouter

with OpenRouter(server_url="https://platform-api.invideo.io/openrouter/api/v1", api_key=os.environ["INVIDEO_API_KEY"]) as client:
    answer = client.chat.send(**json.loads("{\"model\":\"gemini-4-neon\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}"))
    print(answer)
```

### 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/openrouter/api/v1/chat/completions", {
  method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Read `choices[0].message.content`. For streaming, read the deltas from the event stream.

`usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Air scatters blue light more than red light."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 2,
    "cost": "0.000002",
    "invideo_cost": {
      "total_usd": "0.000002",
      "lines": [
        {
          "item": "input_tokens",
          "quantity": "10",
          "unit_price_usd": "0.0000001",
          "amount_usd": "0.000001"
        },
        {
          "item": "output_tokens",
          "quantity": "2",
          "unit_price_usd": "0.0000005",
          "amount_usd": "0.000001"
        }
      ]
    }
  }
}
```

## Perplexity

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

Endpoint `POST /perplexity/chat/completions` · Model ID in `model`.

### curl

```bash
curl https://platform-api.invideo.io/perplexity/chat/completions \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-4-neon",
  "messages": [
    {
      "role": "user",
      "content": "Explain why the sky looks blue in one sentence."
    }
  ]
}'
```

### OpenAI SDK · Python

```python
from openai import OpenAI
import os

client = OpenAI(base_url="https://platform-api.invideo.io/perplexity", api_key=os.environ["INVIDEO_API_KEY"])

answer = client.chat.completions.create(
    model="gemini-4-neon",
    messages=[
        {
            "role": "user",
            "content": "Explain why the sky looks blue in one sentence.",
        },
    ],
)
print(answer.choices[0].message.content)
```

### 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/perplexity/chat/completions", {
  method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Read `choices[0].message.content`. For streaming, read the deltas from the event stream.

`usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Air scatters blue light more than red light."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 2,
    "cost": "0.000002",
    "invideo_cost": {
      "total_usd": "0.000002",
      "lines": [
        {
          "item": "input_tokens",
          "quantity": "10",
          "unit_price_usd": "0.0000001",
          "amount_usd": "0.000001"
        },
        {
          "item": "output_tokens",
          "quantity": "2",
          "unit_price_usd": "0.0000005",
          "amount_usd": "0.000001"
        }
      ]
    }
  }
}
```

## xAI

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

Endpoint `POST /xai/v1/chat/completions` · Model ID in `model`.

### curl

```bash
curl https://platform-api.invideo.io/xai/v1/chat/completions \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-4-neon",
  "messages": [
    {
      "role": "user",
      "content": "Explain why the sky looks blue in one sentence."
    }
  ]
}'
```

### OpenAI SDK · Python

```python
from openai import OpenAI
import os

client = OpenAI(base_url="https://platform-api.invideo.io/xai/v1", api_key=os.environ["INVIDEO_API_KEY"])

answer = client.chat.completions.create(
    model="gemini-4-neon",
    messages=[
        {
            "role": "user",
            "content": "Explain why the sky looks blue in one sentence.",
        },
    ],
)
print(answer.choices[0].message.content)
```

### 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/chat/completions", {
  method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Read `choices[0].message.content`. For streaming, read the deltas from the event stream.

`usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Air scatters blue light more than red light."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 2,
    "cost": "0.000002",
    "invideo_cost": {
      "total_usd": "0.000002",
      "lines": [
        {
          "item": "input_tokens",
          "quantity": "10",
          "unit_price_usd": "0.0000001",
          "amount_usd": "0.000001"
        },
        {
          "item": "output_tokens",
          "quantity": "2",
          "unit_price_usd": "0.0000005",
          "amount_usd": "0.000001"
        }
      ]
    }
  }
}
```

## Z.ai

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

Endpoint `POST /z-ai/api/paas/v4/chat/completions` · Model ID in `model`.

### curl

```bash
curl https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions \
  -H "Authorization: Bearer $INVIDEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-4-neon",
  "messages": [
    {
      "role": "user",
      "content": "Explain why the sky looks blue in one sentence."
    }
  ]
}'
```

### OpenAI SDK · Python

```python
from openai import OpenAI
import os

client = OpenAI(base_url="https://platform-api.invideo.io/z-ai/api/paas/v4", api_key=os.environ["INVIDEO_API_KEY"])

answer = client.chat.completions.create(
    model="gemini-4-neon",
    messages=[
        {
            "role": "user",
            "content": "Explain why the sky looks blue in one sentence.",
        },
    ],
)
print(answer.choices[0].message.content)
```

### 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/z-ai/api/paas/v4/chat/completions", {
  method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());
```

Read `choices[0].message.content`. For streaming, read the deltas from the event stream.

`usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent.

### Example response fields

```json
{
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Air scatters blue light more than red light."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 2,
    "cost": "0.000002",
    "invideo_cost": {
      "total_usd": "0.000002",
      "lines": [
        {
          "item": "input_tokens",
          "quantity": "10",
          "unit_price_usd": "0.0000001",
          "amount_usd": "0.000001"
        },
        {
          "item": "output_tokens",
          "quantity": "2",
          "unit_price_usd": "0.0000005",
          "amount_usd": "0.000001"
        }
      ]
    }
  }
}
```

## Price

From $3.00 / 1M input tokens.

Reasoning tokens are charged at the output rate.

| Token type | Price per 1M tokens |
| --- | --- |
| Input | $3.00 |
| Audio input | $3.00 |
| Cached input | $0.15 |
| Cached audio input | $0.15 |
| Output | $15.00 |

## Input

Use the input shape for the selected format. OpenAI Chat and Anthropic Messages use `messages`. OpenAI Responses uses `input`. Gemini uses `contents`.

## Errors

Errors follow the selected format. For a 429 rate limit, wait for `Retry-After` before retrying. [API errors](/docs/errors)

## Model

| - | - |
| --- | --- |
| Model ID | `gemini-4-neon` |
| Context window | 1,048,576 tokens |
| Max output | 65,536 tokens |
| Features | tools, JSON output, images, PDFs, prompt cache, thinking, audio, video |

## Capabilities

| - | - |
| --- | --- |
| Streaming | yes |
| Tools (function calling) | yes |
| Structured output (JSON schema) | yes |
| Images in messages | yes |
| Reasoning | yes |
