{{ t('h1Overview') }}

{{ t('overviewIntro') }}

{{ t('overviewWhyHeading') }}

  1. {{ t('overviewWhy1') }}
  2. {{ t('overviewWhy2') }}
  3. {{ t('overviewWhy3') }}
  4. {{ t('overviewWhy4') }}

{{ t('h1Quickstart') }}

{{ t('quickstartBody') }} {{ t('quickstartGetKey') }}{{ t('quickstartAndSet') }}

{{ t('quickstartHereIsExample') }}

                    from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

completion = client.chat.completions.create(
    model="gpt-5.4",
    messages=[
        {
            "role": "user",
            "content": "Give me a short panda story"
        }
    ]
)

print(completion.choices[0].message.content)
                    
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const completion = await client.chat.completions.create({
    model: "gpt-5.4",
    messages: [
        { role: "user", content: "Give me a short panda story" }
    ],
});

console.log(completion.choices[0].message.content);
curl https://api.mnnai.ru/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "gpt-5.4",
    "messages": [{"role": "user", "content": "Give me a short panda story"}]
  }'

{{ t('quickstartRunInstallBefore') }} pip install openai{{ t('quickstartRunInstallAfter') }}

{{ t('h1Models') }}

{{ t('modelsIntro') }}

{{ t('modelsExampleList') }}

from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

models = client.models.list()

for model in models.data:
    print(model.id)
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const models = await client.models.list();

for (const model of models.data) {
    console.log(model.id);
}
curl https://api.mnnai.ru/v1/models \
  -H "Authorization: Bearer $MNN_API_KEY"

{{ t('modelsNoteStrong') }} {{ t('modelsNoteBody') }} {{ t('modelsDashboardLink') }}{{ t('modelsNoteAfter') }}

{{ t('h1Pricing') }}

{{ t('pricingIntro') }}

{{ t('pricingTableHeaderFeature') }} {{ t('pricingTableHeaderFree') }} {{ t('pricingTableHeaderBasic') }} {{ t('pricingTableHeaderPro') }} {{ t('pricingTableHeaderUltra') }} {{ t('pricingTableHeaderScale') }} {{ t('pricingTableHeaderEnterprise') }} {{ t('pricingTableHeaderPayg') }}
{{ t('pricingRowPrice') }} $0/mo $5/mo $10/mo $15/mo $30/mo $60/mo {{ t('pricingPaygPrice') }}
{{ t('pricingRowCredits') }} {{ t('pricingCreditsPriceMo') }} $20 $40 $65 $150 $300 {{ t('pricingPaygTopup') }}
{{ t('pricingRowRateLimit') }} 10 50 100 150 200 400 10
{{ t('pricingRowModelAccess') }} {{ t('pricingRateFree') }} {{ t('pricingRateBasic') }} {{ t('pricingRateAll') }} {{ t('pricingRateAll') }} {{ t('pricingRateAll') }} {{ t('pricingRateAll') }} {{ t('pricingRateAll') }}
{{ t('pricingRowWebSearch') }} {{ t('pricingYes') }} {{ t('pricingYes') }} {{ t('pricingYes') }} {{ t('pricingYes') }} {{ t('pricingYes') }} {{ t('pricingYes') }} {{ t('pricingYes') }}
{{ t('pricingRowMediaAnalysis') }} {{ t('pricingMediaTextImage') }} {{ t('pricingAudioPlus') }} {{ t('pricingAudioPlus') }} {{ t('pricingAudioPlus') }} {{ t('pricingAudioPlus') }} {{ t('pricingAudioPlus') }} {{ t('pricingAudioPlus') }}
{{ t('pricingRowFunctionCalling') }} {{ t('pricingNo') }} {{ t('pricingYes') }} {{ t('pricingYes') }} {{ t('pricingYes') }} {{ t('pricingYes') }} {{ t('pricingYes') }} {{ t('pricingYes') }}
{{ t('pricingRowSupport') }} {{ t('pricingStandardSupport') }} {{ t('pricingStandardSupport') }} {{ t('pricingPrioritySupport') }} {{ t('pricingPrioritySupport') }} {{ t('pricingPrioritySupport') }} {{ t('pricingPrioritySupport') }} {{ t('pricingStandardSupport') }}

{{ t('pricingHeadingCredits') }}

{{ t('pricingCredits1') }}

{{ t('pricingCredits2') }}

{{ t('pricingCredits3') }}

{{ t('pricingHeadingFaq') }}

  1. {{ t('pricingFaq1Q') }}

    {{ t('pricingFaq1A') }}

  2. {{ t('pricingFaq2Q') }}

    {{ t('pricingFaq2A') }}

  3. {{ t('pricingFaq3Q') }}

    {{ t('pricingFaq3A') }}

  4. {{ t('pricingFaq4Q') }}

    {{ t('pricingFaq4A') }}

  5. {{ t('pricingFaq5Q') }}

    {{ t('pricingFaq5ABefore') }} {{ t('pricingDiscordLink') }}{{ t('pricingFaq5AAfter') }}

{{ t('pricingHeadingPayg') }}

{{ t('pricingPaygBody') }}

{{ t('h1Locations') }}

{{ t('locationsIntro') }}

https://rapi.mnnai.ru/v1 {{ t('locationsRussia') }}

https://dapi.mnnai.ru/v1 {{ t('locationsGermany') }}

https://api.mnnai.ru/v1 {{ t('locationsGlobal') }}

{{ t('h1TextGeneration') }}

{{ t('textGenIntro') }}

{{ showResponses ? t('apiChatCompletions') : t('apiResponses') }}
from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

response = client.chat.completions.create(
    model="mistral-medium-latest",
    messages=[
        {"role": "user", "content": "Summarize this: [long text]"}
    ],
    temperature=0.7
)

print(response.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const response = await client.chat.completions.create({
    model: "mistral-medium-latest",
    messages: [
        { role: "user", content: "Summarize this: [long text]" }
    ],
    temperature: 0.7
});

console.log(response.choices[0].message.content);
curl https://api.mnnai.ru/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "mistral-medium-latest",
    "messages": [{"role": "user", "content": "Summarize this: [long text]"}],
    "temperature": 0.7
  }'
from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

response = client.responses.create(
    model="mistral-medium-latest",
    input="Write a one-sentence bedtime story about a hypercorn."
)

print(response.output_text)
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const response = await client.responses.create({
    model: "mistral-medium-latest",
    input: "Write a one-sentence bedtime story about a hypercorn."
});

console.log(response.output_text);
curl https://api.mnnai.ru/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "mistral-medium-latest",
    "input": "Write a one-sentence bedtime story about a hypercorn."
  }'

{{ t('h1Reasoning') }}

{{ t('reasoningIntro') }}

{{ t('reasoningEffortModelsBefore') }} GET /v1/models {{ t('reasoningEffortModelsBetween') }} effort_types {{ t('reasoningEffortModelsAfter') }}

{{ t('reasoningEffortFieldsBefore') }} reasoning_effort {{ t('reasoningEffortFieldsChat') }} reasoning.effort {{ t('reasoningEffortFieldsResponses') }} output_config.effort {{ t('reasoningEffortFieldsAfter') }}

{{ showResponses ? t('apiChatCompletions') : t('apiResponses') }}
from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

prompt = """
Write a bash script that takes a matrix represented as a string with
format '[1,2],[3,4],[5,6]' and prints the transpose in the same format.
"""

response = client.chat.completions.create(
    model="glm-5",
    reasoning_effort="medium",
    messages=[
        {
            "role": "user",
            "content": prompt
        }
    ]
)

print(response.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const prompt = `
Write a bash script that takes a matrix represented as a string with
format '[1,2],[3,4],[5,6]' and prints the transpose in the same format.
`;

const response = await client.chat.completions.create({
    model: "glm-5",
    reasoning_effort: "medium",
    messages: [
        { role: "user", content: prompt }
    ],
});

console.log(response.choices[0].message.content);
curl https://api.mnnai.ru/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "glm-5",
    "reasoning_effort": "medium",
    "messages": [{"role": "user", "content": "Write a bash script that takes a matrix represented as a string with format [1,2],[3,4],[5,6] and prints the transpose in the same format."}]
  }'
from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

prompt = """
Write a bash script that takes a matrix represented as a string with
format '[1,2],[3,4],[5,6]' and prints the transpose in the same format.
"""

response = client.responses.create(
    model="glm-5",
    reasoning={"effort": "medium"},
    input=[
        {
            "role": "user",
            "content": prompt
        }
    ]
)

print(response.output_text)
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const prompt = `
Write a bash script that takes a matrix represented as a string with
format '[1,2],[3,4],[5,6]' and prints the transpose in the same format.
`;

const response = await client.responses.create({
    model: "glm-5",
    reasoning: { effort: "medium" },
    input: [
        { role: "user", content: prompt }
    ],
});

console.log(response.output_text);
curl https://api.mnnai.ru/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "glm-5",
    "reasoning": {"effort": "medium"},
    "input": [{"role": "user", "content": "Write a bash script that takes a matrix represented as a string with format [1,2],[3,4],[5,6] and prints the transpose in the same format."}]
  }'

{{ t('reasoningNote1') }}

{{ t('reasoningFormatTitle') }}

{{ t('reasoningFormatDesc') }}

{{ t('reasoningOutdatedTitle') }}

{{ t('reasoningOutdatedDesc') }}

curl https://api.mnnai.ru/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "glm-5",
    "reasoning_effort": "medium",
    "outdated_reasoning": true,
    "messages": [{"role": "user", "content": "Explain quantum entanglement briefly."}]
  }'
response = client.chat.completions.create(
    model="glm-5",
    reasoning_effort="medium",
    extra_body={"outdated_reasoning": True},
    messages=[
        {"role": "user", "content": "Explain quantum entanglement briefly."}
    ]
)
const response = await client.chat.completions.create({
    model: "glm-5",
    reasoning_effort: "medium",
    outdated_reasoning: true,
    messages: [
        { role: "user", content: "Explain quantum entanglement briefly." }
    ]
});

{{ t('h1PromptCaching') }}

{{ t('cachingIntro') }}

{{ t('cachingModelsTitle') }}

Chat Completions, Responses {{ t('cachingFormatOpenai') }}
prompt_cache_key
Messages {{ t('cachingFormatAnthropic') }}
cache_control: {"type": "ephemeral"}

{{ t('cachingSupportedModels') }}

{{ t('cachingOpenaiTitle') }}

{{ t('cachingOpenaiBefore') }} prompt_cache_key{{ t('cachingOpenaiAfter') }}

from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

long_instructions = open("instructions.txt").read()  # a long, stable text

response = client.chat.completions.create(
    model="claude-sonnet-5-5",  # or gpt-6-luna, grok-4.7
    prompt_cache_key="tenant-acme-support-agent",
    messages=[
        {"role": "system", "content": long_instructions},
        {"role": "user", "content": "Summarize rule 12."}
    ]
)

details = response.usage.prompt_tokens_details
print(details.cached_tokens, details.cache_write_tokens)
import OpenAI from "openai";
import fs from "node:fs";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1"
});

const longInstructions = fs.readFileSync("instructions.txt", "utf8"); // a long, stable text

const response = await client.chat.completions.create({
    model: "claude-sonnet-5-5", // or gpt-6-luna, grok-4.7
    prompt_cache_key: "tenant-acme-support-agent",
    messages: [
        { role: "system", content: longInstructions },
        { role: "user", content: "Summarize rule 12." }
    ]
});

console.log(response.usage.prompt_tokens_details);
curl https://api.mnnai.ru/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "claude-sonnet-5-5",
    "prompt_cache_key": "tenant-acme-support-agent",
    "messages": [
      {"role": "system", "content": "<long, stable instructions>"},
      {"role": "user", "content": "Summarize rule 12."}
    ]
  }'
{{ t('cachingKeyLabel') }}
{{ t('cachingKeyRule') }}
{{ t('cachingClaudeLabel') }}
{{ t('cachingClaudeAuto') }} {{ t('cachingClaudeExplicit') }}
{{ t('cachingGptOptionsLabel') }}
prompt_cache_options: {"mode": "implicit" | "explicit", "ttl": "30m"}. prompt_cache_breakpoint: {"mode": "explicit"} {{ t('cachingGptBreakpoint') }}
Grok
{{ t('cachingGrokOnly') }} prompt_cache_key.
{{ t('cachingMinPrefixLabel') }}
{{ t('cachingMinPrefix') }}
{{ t('cachingLifetimeLabel') }}
{{ t('cachingLifetimeOpenai') }}

{{ t('cachingAnthropicTitle') }}

{{ t('cachingAnthropicBefore') }} cache_control{{ t('cachingAnthropicAfter') }}

import anthropic

client = anthropic.Anthropic(
    base_url="https://api.mnnai.ru"
)

response = client.messages.create(
    model="claude-sonnet-5-5",
    max_tokens=1024,
    system=[
        {
            "type": "text",
            "text": long_instructions,
            "cache_control": {"type": "ephemeral"}
        }
    ],
    messages=[
        {"role": "user", "content": "Summarize rule 12."}
    ]
)

print(response.usage.cache_read_input_tokens, response.usage.cache_creation_input_tokens)
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
    baseURL: "https://api.mnnai.ru"
});

const response = await client.messages.create({
    model: "claude-sonnet-5-5",
    max_tokens: 1024,
    system: [
        {
            type: "text",
            text: longInstructions,
            cache_control: { type: "ephemeral" }
        }
    ],
    messages: [
        { role: "user", content: "Summarize rule 12." }
    ]
});

console.log(response.usage);
curl https://api.mnnai.ru/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: $MNN_API_KEY" \
  -d '{
    "model": "claude-sonnet-5-5",
    "max_tokens": 1024,
    "system": [
      {
        "type": "text",
        "text": "<long, stable instructions>",
        "cache_control": {"type": "ephemeral"}
      }
    ],
    "messages": [
      {"role": "user", "content": "Summarize rule 12."}
    ]
  }'
{{ t('cachingMarkersLabel') }}
{{ t('cachingClaudeMarkers') }}
{{ t('cachingLifetimeLabel') }}
ttl: "5m" {{ t('cachingDefault') }} {{ t('cachingOr') }} "1h".
{{ t('cachingMinPrefixLabel') }}
{{ t('cachingMinPrefix') }}
ChatGPT, Grok
{{ t('cachingAnthropicOther') }}

{{ t('cachingUsageTitle') }}

{{ t('cachingUsageBefore') }} prompt_tokens {{ t('cachingUsageAfter') }}

Chat Completions
{{ t('cachingReadLabel') }}usage.prompt_tokens_details.cached_tokens
{{ t('cachingWriteLabel') }}usage.prompt_tokens_details.cache_write_tokens
{{ t('cachingChatWriteNote') }}
Responses
{{ t('cachingReadLabel') }}usage.input_tokens_details.cached_tokens
{{ t('cachingWriteLabel') }}usage.input_tokens_details.cache_write_tokens
Messages
{{ t('cachingReadLabel') }}usage.cache_read_input_tokens
{{ t('cachingWriteLabel') }}usage.cache_creation_input_tokens
input_tokens {{ t('cachingMessagesInput') }}

{{ t('cachingUsageExample') }}

{
  "usage": {
    "prompt_tokens": 2479,
    "completion_tokens": 4,
    "total_tokens": 2483,
    "prompt_tokens_details": {
      "cached_tokens": 2465,
      "cache_write_tokens": 0
    }
  }
}

{{ t('cachingPricingTitle') }}

{{ t('cachingPricingIntro') }} in_cost_per_million.

  • {{ t('cachingPricingRead') }}
  • {{ t('cachingPricingWrite') }}
  • {{ t('cachingPricingOutput') }}

{{ t('cachingPricingFields') }} GET /v1/models

pricing.cache_read_cost_per_million
{{ t('cachingPriceReadField') }}
pricing.cache_write_cost_per_million
{{ t('cachingPriceWriteField') }}
pricing.cache_write_1h_cost_per_million
{{ t('cachingPriceHourField') }}

{{ t('cachingPricingFallback') }} cache_write_cost_per_million.

{{ t('h1Images') }}

{{ t('imagesIntro') }}

from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

response = client.images.generate(
    model="z-image-turbo",
    prompt="A futuristic city at sunset",
    extra_body={"enhance": True} # If this parameter is specified, your prompt will be automatically enhanced
)

print(response.data[0].url)
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const response = await client.images.generate({
    model: "z-image-turbo",
    prompt: "A futuristic city at sunset",
    extra_body: { enhance: true }
});

console.log(response.data[0].url);
curl https://api.mnnai.ru/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "z-image-turbo",
    "prompt": "A futuristic city at sunset",
    "enhance": true
  }'

{{ t('imagesNoteStrong') }} {{ t('imagesNoteBody') }}

{{ t('h1Edits') }}

{{ t('editsIntro') }}

from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

response = client.images.edit(
    model="gpt-image-1-edit",
    image=open("cat.png", "rb"),
    prompt="Change the background of the image to space",
    response_format="url"
)
print(response.data[0].url)
import OpenAI from "openai";
import fs from "fs";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const response = await client.images.edit({
    model: "gpt-image-1-edit",
    image: fs.createReadStream("cat.png"),
    prompt: "Change the background of the image to space",
    response_format: "url"
});

console.log(response.data[0].url);
curl https://api.mnnai.ru/v1/images/edits \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -F image="@cat.png" \
  -F model="gpt-image-1-edit" \
  -F prompt="Change the background of the image to space" \
  -F response_format="url"

{{ t('h1Videos') }}

{{ t('videosIntro') }}

{{ t('videosEndpoints') }}

POST/v1/videos/generations
{{ t('videosCreate') }}
GET/v1/videos/{request_id}
{{ t('videosFetch') }}

{{ t('videosParameters') }}

modelstring, {{ t('videosRequired') }}
{{ t('videosModel') }}
grok-imagine-video-1.5
grok-imagine-video-1.5-lite
promptstring, {{ t('videosRequired') }}
{{ t('videosPrompt') }}
durationinteger
{{ t('videosDuration') }}
resolutionstring
{{ t('videosResolution') }}
aspect_ratiostring
{{ t('videosAspectRatio') }}
1:1 16:9 9:16 4:3 3:4 3:2 2:3 21:9 5:2
imagestring
{{ t('videosImage') }}
reference_imagesarray<string>
{{ t('videosReferences') }}

{{ t('videosExample') }}

import os
import time

import requests

base_url = "https://api.mnnai.ru/v1"
headers = {"Authorization": f"Bearer {os.environ['MNN_API_KEY']}"}

response = requests.post(
    f"{base_url}/videos/generations",
    headers=headers,
    json={
        "model": "grok-imagine-video-1.5",
        "prompt": "A cinematic flight over a mountain lake at sunrise",
        "duration": 8,
        "aspect_ratio": "16:9",
        "resolution": "720p"
    },
    timeout=120
)
response.raise_for_status()
request_id = response.json()["request_id"]
print(request_id)

deadline = time.monotonic() + 1800
while time.monotonic() < deadline:
    time.sleep(10)
    response = requests.get(
        f"{base_url}/videos/{request_id}",
        headers=headers,
        timeout=180
    )
    response.raise_for_status()
    result = response.json()

    if result["status"] == "done":
        print(result["video"]["url"])
        print(result["video"]["duration"])
        break

    if result["status"] == "failed":
        raise RuntimeError(result["error"])
else:
    raise TimeoutError(f"Check the task again later: {request_id}")
const baseUrl = "https://api.mnnai.ru/v1";
const headers = {
    Authorization: `Bearer ${process.env.MNN_API_KEY}`,
    "Content-Type": "application/json"
};

let response = await fetch(`${baseUrl}/videos/generations`, {
    method: "POST",
    headers,
    body: JSON.stringify({
        model: "grok-imagine-video-1.5",
        prompt: "A cinematic flight over a mountain lake at sunrise",
        duration: 8,
        aspect_ratio: "16:9",
        resolution: "720p"
    }),
    signal: AbortSignal.timeout(120000)
});
if (!response.ok) throw new Error(await response.text());
const { request_id } = await response.json();
console.log(request_id);

const deadline = Date.now() + 1800000;
let video;
while (Date.now() < deadline) {
    await new Promise(resolve => setTimeout(resolve, 10000));
    response = await fetch(`${baseUrl}/videos/${request_id}`, {
        headers,
        signal: AbortSignal.timeout(180000)
    });
    if (!response.ok) throw new Error(await response.text());
    const result = await response.json();

    if (result.status === "done") {
        video = result.video;
        break;
    }
    if (result.status === "failed") {
        throw new Error(JSON.stringify(result.error));
    }
}
if (!video) throw new Error(`Check the task again later: ${request_id}`);
console.log(video.url);
console.log(video.duration);
curl --fail-with-body --max-time 120 \
  https://api.mnnai.ru/v1/videos/generations \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-video-1.5",
    "prompt": "A cinematic flight over a mountain lake at sunrise",
    "duration": 8,
    "aspect_ratio": "16:9",
    "resolution": "720p"
  }'

{{ t('videosStatus') }}

REQUEST_ID="video_..."

curl --fail-with-body --max-time 180 \
  "https://api.mnnai.ru/v1/videos/$REQUEST_ID" \
  -H "Authorization: Bearer $MNN_API_KEY"

{{ t('videosImageExample') }}

{
  "image": "https://example.com/scene.jpg",
  "reference_images": ["https://example.com/character.jpg"],
  "resolution": "720p"
}

{{ t('videosResponses') }}

{{ t('videosCreated') }}

{
  "request_id": "video_..."
}

pending

{{ t('videosPending') }}

{
  "status": "pending"
}

done

{{ t('videosDone') }}

{
  "status": "done",
  "video": {
    "url": "https://rapi.mnnai.ru/videos/abc123.mp4",
    "duration": 8,
    "respect_moderation": true
  },
  "model": "grok-imagine-video-1.5"
}

failed

{{ t('videosFailed') }}

{
  "status": "failed",
  "error": {
    "code": "video_generation_failed",
    "message": "Video generation failed"
  }
}

{{ t('videosStorage') }}

{{ t('videosPricing') }}

{{ t('videosModelHeading') }} 480p 720p 1080p
grok-imagine-video-1.5$0.08$0.14$0.25
grok-imagine-video-1.5-lite$0.02$0.03$0.14

{{ t('videosBilling') }}

{{ t('videosPriceExample') }}

{{ t('h1Vision') }}

{{ t('visionIntro') }}

{{ showVisionResponses ? t('apiChatCompletions') : t('apiResponses') }}
from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

response = client.chat.completions.create(
    model="gpt-5.2",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "What's in this image?"},
            {
                "type": "image_url",
                "image_url": {
                    "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
                },
            },
        ],
    }],
)

print(response.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const response = await client.chat.completions.create({
    model: "gpt-5.2",
    messages: [
        {
            role: "user",
            content: [
                { type: "text", text: "What's in this image?" },
                {
                    type: "image_url",
                    image_url: {
                        url: "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
                    },
                },
            ],
        },
    ],
});

console.log(response.choices[0].message.content);
curl https://api.mnnai.ru/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "gpt-5.2",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "What is in this image?"
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
            }
          }
        ]
      }
    ]
  }'
from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

response = client.responses.create(
    model="gpt-5.2",
    input=[{
        "role": "user",
        "content": [
            {"type": "input_text", "text": "what's in this image?"},
            {
                "type": "input_image",
                "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
            },
        ],
    }],
)

print(response.output_text)
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const response = await client.responses.create({
    model: "gpt-5.2",
    input: [
        {
            role: "user",
            content: [
                { type: "input_text", text: "what's in this image?" },
                {
                    type: "input_image",
                    image_url: "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
                },
            ],
        },
    ],
});

console.log(response.output_text);
curl https://api.mnnai.ru/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "gpt-5.2",
    "input": [
      {
        "role": "user",
        "content": [
          {
            "type": "input_text",
            "text": "what is in this image?"
          },
          {
            "type": "input_image",
            "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
          }
        ]
      }
    ]
  }'

{{ t('h1Pdf') }}

{{ t('pdfIntro') }}

{{ showVisionResponses ? t('apiChatCompletions') : t('apiResponses') }}
import base64
from openai import OpenAI

def encode_pdf_to_base64(pdf_path):
    with open(pdf_path, "rb") as pdf_file:
        return base64.b64encode(pdf_file.read()).decode("utf-8")

client = OpenAI(
    base_url="https://api.mnnai.ru/v1",
    api_key="your-api-key"
)

pdf_path = "document.pdf"
base64_pdf = encode_pdf_to_base64(pdf_path)
data_url = f"data:application/pdf;base64,{base64_pdf}"

response = client.chat.completions.create(
    model="gemini-3.1-flash-lite-preview",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "What is this document about?"},
            {
                "type": "file",
                "file": {
                    "filename": "document.pdf",
                    "file_data": data_url
                }
            },
        ],
    }],
)

print(response.choices[0].message.content)
import fs from "fs";
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const pdfPath = "document.pdf";
const pdfBuffer = fs.readFileSync(pdfPath);
const base64Pdf = pdfBuffer.toString("base64");
const dataUrl = `data:application/pdf;base64,${base64Pdf}`;

const response = await client.chat.completions.create({
    model: "gemini-3.1-flash-lite-preview",
    messages: [
        {
            role: "user",
            content: [
                { type: "text", text: "What is this document about?" },
                {
                    type: "file",
                    file: {
                        filename: "document.pdf",
                        file_data: dataUrl
                    }
                },
            ],
        },
    ],
});

console.log(response.choices[0].message.content);
# Replace YOUR_BASE64_STRING with the actual base64 string of your PDF document
curl https://api.mnnai.ru/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "gemini-3.1-flash-lite-preview",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "What is this document about?"
          },
          {
            "type": "file",
            "file": {
              "filename": "document.pdf",
              "file_data": "data:application/pdf;base64,YOUR_BASE64_STRING"
            }
          }
        ]
      }
    ]
  }'
import base64
from openai import OpenAI

def encode_pdf_to_base64(pdf_path):
    with open(pdf_path, "rb") as pdf_file:
        return base64.b64encode(pdf_file.read()).decode("utf-8")

client = OpenAI(
    base_url="https://api.mnnai.ru/v1",
    api_key="your-api-key"
)

pdf_path = "document.pdf"
base64_pdf = encode_pdf_to_base64(pdf_path)
data_url = f"data:application/pdf;base64,{base64_pdf}"

response = client.responses.create(
    model="gemini-3.1-flash-lite-preview",
    input=[{
        "role": "user",
        "content": [
            {"type": "input_text", "text": "What is this document about?"},
            {
                "type": "input_file",
                "file": {
                    "filename": "document.pdf",
                    "file_data": data_url
                }
            },
        ],
    }],
)

print(response.output_text)
import fs from "fs";
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const pdfPath = "document.pdf";
const pdfBuffer = fs.readFileSync(pdfPath);
const base64Pdf = pdfBuffer.toString("base64");
const dataUrl = `data:application/pdf;base64,${base64Pdf}`;

const response = await client.responses.create({
    model: "gemini-3.1-flash-lite-preview",
    input: [
        {
            role: "user",
            content: [
                { type: "input_text", text: "What is this document about?" },
                {
                    type: "input_file",
                    file: {
                        filename: "document.pdf",
                        file_data: dataUrl
                    }
                },
            ],
        },
    ],
});

console.log(response.output_text);
# Replace YOUR_BASE64_STRING with the actual base64 string of your PDF document
curl https://api.mnnai.ru/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "gemini-3.1-flash-lite-preview",
    "input": [
      {
        "role": "user",
        "content": [
          {
            "type": "input_text",
            "text": "What is this document about?"
          },
          {
            "type": "input_file",
            "file": {
              "filename": "document.pdf",
              "file_data": "data:application/pdf;base64,YOUR_BASE64_STRING"
            }
          }
        ]
      }
    ]
  }'

{{ t('h1Stt') }}

{{ t('sttIntro') }}

from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

with open("audio.mp3", "rb") as audio_file:
    transcription = client.audio.transcriptions.create(
        model="whisper-1",
        file=audio_file
    )

print(transcription.text)
import OpenAI from "openai";
import fs from "fs";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const transcription = await client.audio.transcriptions.create({
    model: "whisper-1",
    file: fs.createReadStream("audio.mp3"),
});

console.log(transcription.text);
curl https://api.mnnai.ru/v1/audio/transcriptions \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -F model="whisper-1" \
  -F file="@audio.mp3"

{{ t('h1Translations') }}

{{ t('translationsIntro') }}

from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

with open("audio.mp3", "rb") as audio_file:
    transcription = client.audio.translations.create(
        model="whisper-1",
        file=audio_file
    )

print(transcription.text)
import OpenAI from "openai";
import fs from "fs";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const translation = await client.audio.translations.create({
    model: "whisper-1",
    file: fs.createReadStream("audio.mp3"),
});

console.log(translation.text);
curl https://api.mnnai.ru/v1/audio/translations \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -F model="whisper-1" \
  -F file="@audio.mp3"

{{ t('h1Tts') }}

{{ t('ttsIntro') }}

from openai import OpenAI
from pathlib import Path

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

speech_file_path = Path(__file__).parent / "speech.mp3"

with client.audio.speech.with_streaming_response.create(
    model="qwen-3-tts-flash",
    voice="Cherry",
    input="The quick brown fox jumped over the lazy dog."
) as response:
    response.stream_to_file(speech_file_path)
import OpenAI from "openai";
import fs from "fs";
import path from "path";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const speechFile = path.resolve("./speech.mp3");

const mp3 = await client.audio.speech.create({
    model: "qwen-3-tts-flash",
    voice: "Cherry",
    input: "The quick brown fox jumped over the lazy dog.",
});

const buffer = Buffer.from(await mp3.arrayBuffer());
await fs.promises.writeFile(speechFile, buffer);
curl https://api.mnnai.ru/v1/audio/speech \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-3-tts-flash",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "Cherry"
  }' \
  --output speech.mp3

{{ t('h1Moderation') }}

{{ t('moderationIntro') }}

from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

response = client.moderations.create(input="This is a safe sentence.")
print(response.results[0].flagged)
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const moderation = await client.moderations.create({ input: "This is a safe sentence." });

console.log(moderation.results[0].flagged);
curl https://api.mnnai.ru/v1/moderations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "input": "This is a safe sentence."
  }'

{{ t('h1Embedding') }}

{{ t('embeddingIntro') }}

from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

response = client.embeddings.create(
  model="text-embedding-3-small",
  input="The quick brown fox jumps over the lazy dog"
)

print(response.data[0].embedding)
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const embedding = await client.embeddings.create({
    model: "text-embedding-3-small",
    input: "The quick brown fox jumps over the lazy dog",
});

console.log(embedding.data[0].embedding);
curl https://api.mnnai.ru/v1/embeddings \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "input": "The quick brown fox jumps over the lazy dog",
    "model": "text-embedding-3-small"
  }'

{{ t('h1FunctionCalling') }}

{{ t('functionCallingIntro') }}

{{ showResponses ? t('apiChatCompletions') : t('apiResponses') }}
from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

tools = [{
    "type": "function",
    "function": {
        "name": "get_weather",
        "description": "Get current temperature for a given location.",
        "parameters": {
            "type": "object",
            "properties": {
                "location": {
                    "type": "string",
                    "description": "City and country e.g. Bogotá, Colombia"
                }
            },
            "required": [
                "location"
            ],
            "additionalProperties": False
        },
        "strict": True
    }
}]

completion = client.chat.completions.create(
    model="gpt-5",
    messages=[{"role": "user", "content": "What is the weather like in Paris today?"}],
    tools=tools
)

print(completion.choices[0].message.tool_calls)
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const tools = [
    {
        type: "function",
        function: {
            name: "get_weather",
            description: "Get current temperature for a given location.",
            parameters: {
                type: "object",
                properties: {
                    location: {
                        type: "string",
                        description: "City and country e.g. Bogotá, Colombia",
                    },
                },
                required: ["location"],
                additionalProperties: false,
            },
            strict: true,
        },
    },
];

const completion = await client.chat.completions.create({
    model: "gpt-5",
    messages: [{ role: "user", content: "What is the weather like in Paris today?" }],
    tools: tools,
});

console.log(completion.choices[0].message.tool_calls);
curl https://api.mnnai.ru/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "gpt-5",
    "messages": [{"role": "user", "content": "What is the weather like in Paris today?"}],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "get_weather",
          "description": "Get current temperature for a given location.",
          "parameters": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "description": "City and country e.g. Bogotá, Colombia"
              }
            },
            "required": ["location"],
            "additionalProperties": false
          },
          "strict": true
        }
      }
    ]
  }'
from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

tools = [{
    "type": "function",
    "name": "get_weather",
    "description": "Get current temperature for a given location.",
    "parameters": {
        "type": "object",
        "properties": {
            "location": {
                "type": "string",
                "description": "City and country e.g. Bogotá, Colombia"
            }
        },
        "required": [
            "location"
        ],
        "additionalProperties": False
    }
}]

response = client.responses.create(
    model="gpt-5",
    input=[{"role": "user", "content": "What is the weather like in Paris today?"}],
    tools=tools
)

print(response.output)
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const tools = [
    {
        type: "function",
        name: "get_weather",
        description: "Get current temperature for a given location.",
        parameters: {
            type: "object",
            properties: {
                location: {
                    type: "string",
                    description: "City and country e.g. Bogotá, Colombia",
                },
            },
            required: ["location"],
            additionalProperties: false,
        },
    },
];

const response = await client.responses.create({
    model: "gpt-5",
    input: [{ role: "user", content: "What is the weather like in Paris today?" }],
    tools: tools,
});

console.log(response.output);
curl https://api.mnnai.ru/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "gpt-5",
    "input": [{"role": "user", "content": "What is the weather like in Paris today?"}],
    "tools": [
      {
        "type": "function",
        "name": "get_weather",
        "description": "Get current temperature for a given location.",
        "parameters": {
          "type": "object",
          "properties": {
            "location": {
              "type": "string",
              "description": "City and country e.g. Bogotá, Colombia"
            }
          },
          "required": ["location"],
          "additionalProperties": false
        }
      }
    ]
  }'

{{ t('functionCallingNoteStrong') }} {{ t('functionCallingNoteBody') }} {{ t('functionCallingDashboardLink') }} {{ t('functionCallingNoteTail') }}

{{ t('h1WebAccess') }}

{{ t('webAccessIntro') }}

from openai import OpenAI

client = OpenAI(
    base_url="https://api.mnnai.ru/v1"
)

response = client.responses.create(
    model="gpt-4o",
    tools=[{"type": "web_search_preview"}],
    input="What was a positive news story from today?"
)

print(response.output_text)
import OpenAI from "openai";

const client = new OpenAI({
    baseURL: "https://api.mnnai.ru/v1",
    apiKey: "your-api-key"
});

const response = await client.responses.create({
    model: "gpt-4o",
    tools: [{ type: "web_search_preview" }],
    input: "What was a positive news story from today?",
});

console.log(response.output_text);
curl https://api.mnnai.ru/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MNN_API_KEY" \
  -d '{
    "model": "gpt-4o",
    "tools": [{"type": "web_search_preview"}],
    "input": "What was a positive news story from today?"
  }'

{{ t('webAccessNoteStrong') }} {{ t('webAccessNoteBody') }} deepseek-v3-0324-search.

{{ t('h1AnthropicSdk') }}

{{ t('anthropicSdkIntro') }}

import anthropic

client = anthropic.Anthropic(
    base_url="https://api.mnnai.ru/",
    api_key="your-mnn-api-key"
)

message = client.messages.create(
    model="claude-4.6-sonnet",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello, Claude"}
    ]
)

print(message.content[0].text)
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
    baseURL: "https://api.mnnai.ru/",
    apiKey: "your-mnn-api-key"
});

const message = await client.messages.create({
    model: "claude-4.6-sonnet",
    max_tokens: 1024,
    messages: [
        { role: "user", content: "Hello, Claude" }
    ],
});

console.log(message.content[0].text);
curl https://api.mnnai.ru/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: $MNN_API_KEY" \
  -d '{
    "model": "claude-4.6-sonnet",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello, Claude"}]
  }'

{{ t('anthropicReasoningTitle') }}

{{ t('anthropicReasoningDescBefore') }} output_config. {{ t('anthropicReasoningDescBetween') }} effort_types {{ t('anthropicReasoningDescAfter') }} /v1/models.

message = client.messages.create(
    model="claude-4.6-sonnet",
    max_tokens=1024,
    output_config={"effort": "medium"},
    messages=[{"role": "user", "content": "Solve this step by step."}]
)

{{ t('h1ClaudeCode') }}

{{ t('claudeCodeIntro') }}

{{ t('h2Setup') }}

  1. {{ t('claudeCodeSetup1Before') }} npm install -g @anthropic-ai/claude-code
  2. {{ t('claudeCodeSetup2') }}
export ANTHROPIC_BASE_URL="https://api.mnnai.ru/v1"
export ANTHROPIC_API_KEY="your-mnn-api-key"

{{ t('claudeCodeRunItBefore') }} claude {{ t('claudeCodeRunItAfter') }}

{{ t('h1Codex') }}

{{ t('codexIntro') }}

{{ t('h2Setup') }}

  1. {{ t('codexSetup1Before') }} npm install -g @openai/codex
  2. {{ t('codexSetup2') }} ~/.codex/config.toml
model = "gpt-5.6-sol"
model_provider = "custom"
model_reasoning_effort = "low"
service_tier = "default"
approval_policy = "on-request"
sandbox_mode = "workspace-write"

[model_providers.custom]
name = "mnn"
base_url = "https://api.mnnai.ru/v1"
env_key = "OPENAI_API_KEY"
requires_openai_auth = false
wire_api = "responses"
  1. {{ t('codexSetup3') }}
export OPENAI_API_KEY="your-mnn-api-key"

{{ t('codexRunItBefore') }} codex {{ t('codexRunItAfter') }}

{{ t('h1Opencode') }}

{{ t('opencodeIntro') }}

{{ t('h2Setup') }}

  1. {{ t('opencodeSetup1Before') }} curl -fsSL https://opencode.ai/install | bash
  2. {{ t('opencodeSetup2') }}
source ~/.zshrc
nano ~/.config/opencode/config.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "my_custom_provider": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "MNN",
      "options": {
        "baseURL": "https://api.mnnai.ru/v1"
      },
      "models": {
        "glm-5.1": {
          "name": "GLM 5.1"
        },
        "grok-4.20": {
          "name": "Grok 4.20"
        },
        "gpt-5.4": {
          "name": "GPT 5.4"
        },
        "claude-4.6-sonnet": {
          "name": "Claude 4.6 Sonnet"
        }
      }
    }
  }
}
                

{{ t('opencodeRunItBefore') }} opencode {{ t('opencodeRunItAfter') }}