Для получения чистого Markdown любой страницы добавьте .md к URL страницы.
Для полного индекса документации см. https://api.vega.chat/docs/llms.txt.
Для полного содержания документации см. https://api.vega.chat/docs/llms-full.txt.
Для интеграции AI‑клиента (Claude Code, Cursor и др.) подключитесь к MCP‑серверу по адресу https://api.vega.chat/docs/_mcp/server.

Reasoning

MD версия

Этот API находится в бета‑версии и может содержать несовместимые изменения.

Responses API Beta поддерживает расширенные возможности рассуждения, позволяя моделям показывать свой внутренний процесс рассуждения с настраиваемыми уровнями усилий.

Конфигурация рассуждения

Настройте поведение рассуждения с помощью параметра reasoning:

typescript
const response = await fetch('https://api.vega.chat/api/v1/responses', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_VEGA_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'openai/o4-mini',
    input: 'What is the meaning of life?',
    reasoning: {
      effort: 'high'
    },
    max_output_tokens: 9000,
  }),
});

const result = await response.json();
console.log(result);
python
import requests

response = requests.post(
    'https://api.vega.chat/api/v1/responses',
    headers={
        'Authorization': 'Bearer YOUR_VEGA_API_KEY',
        'Content-Type': 'application/json',
    },
    json={
        'model': 'openai/o4-mini',
        'input': 'What is the meaning of life?',
        'reasoning': {
            'effort': 'high'
        },
        'max_output_tokens': 9000,
    }
)

result = response.json()
print(result)
bash
curl -X POST https://api.vega.chat/api/v1/responses \
  -H "Authorization: Bearer YOUR_VEGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/o4-mini",
    "input": "What is the meaning of life?",
    "reasoning": {
      "effort": "high"
    },
    "max_output_tokens": 9000
  }'

Уровни усилий рассуждения

Параметр effort определяет, сколько вычислительных ресурсов модель потратит на рассуждение:

Уровень усилийОписание
minimalБазовое рассуждение с минимальными вычислительными затратами
lowЛёгкое рассуждение для простых задач
mediumСбалансированное рассуждение для умеренной сложности
highГлубокое рассуждение для сложных задач

Пример сложного рассуждения

Для сложных математических или логических задач:

typescript
const response = await fetch('https://api.vega.chat/api/v1/responses', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_VEGA_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'openai/o4-mini',
    input: [
      {
        type: 'message',
        role: 'user',
        content: [
          {
            type: 'input_text',
            text: 'Was 1995 30 years ago? Please show your reasoning.',
          },
        ],
      },
    ],
    reasoning: {
      effort: 'high'
    },
    max_output_tokens: 9000,
  }),
});

const result = await response.json();
console.log(result);
python
import requests

response = requests.post(
    'https://api.vega.chat/api/v1/responses',
    headers={
        'Authorization': 'Bearer YOUR_VEGA_API_KEY',
        'Content-Type': 'application/json',
    },
    json={
        'model': 'openai/o4-mini',
        'input': [
            {
                'type': 'message',
                'role': 'user',
                'content': [
                    {
                        'type': 'input_text',
                        'text': 'Was 1995 30 years ago? Please show your reasoning.',
                    },
                ],
            },
        ],
        'reasoning': {
            'effort': 'high'
        },
        'max_output_tokens': 9000,
    }
)

result = response.json()
print(result)

Рассуждение в контексте диалога

Включите рассуждение в многовопросные беседы:

typescript
const response = await fetch('https://api.vega.chat/api/v1/responses', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_VEGA_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'openai/o4-mini',
    input: [
      {
        type: 'message',
        role: 'user',
        content: [
          {
            type: 'input_text',
            text: 'What is your favorite color?',
          },
        ],
      },
      {
        type: 'message',
        role: 'assistant',
        id: 'msg_abc123',
        status: 'completed',
        content: [
          {
            type: 'output_text',
            text: "I don't have a favorite color.",
            annotations: []
          }
        ]
      },
      {
        type: 'message',
        role: 'user',
        content: [
          {
            type: 'input_text',
            text: 'How many Earths can fit on Mars?',
          },
        ],
      },
    ],
    reasoning: {
      effort: 'high'
    },
    max_output_tokens: 9000,
  }),
});

const result = await response.json();
console.log(result);
python
import requests

response = requests.post(
    'https://api.vega.chat/api/v1/responses',
    headers={
        'Authorization': 'Bearer YOUR_VEGA_API_KEY',
        'Content-Type': 'application/json',
    },
    json={
        'model': 'openai/o4-mini',
        'input': [
            {
                'type': 'message',
                'role': 'user',
                'content': [
                    {
                        'type': 'input_text',
                        'text': 'What is your favorite color?',
                    },
                ],
            },
            {
                'type': 'message',
                'role': 'assistant',
                'id': 'msg_abc123',
                'status': 'completed',
                'content': [
                    {
                        'type': 'output_text',
                        'text': "I don't have a favorite color.",
                        'annotations': []
                    }
                ]
            },
            {
                'type': 'message',
                'role': 'user',
                'content': [
                    {
                        'type': 'input_text',
                        'text': 'How many Earths can fit on Mars?',
                    },
                ],
            },
        ],
        'reasoning': {
            'effort': 'high'
        },
        'max_output_tokens': 9000,
    }
)

result = response.json()
print(result)

Потоковое рассуждение

Включите потоковую передачу, чтобы наблюдать развитие рассуждения в реальном времени:

typescript
const response = await fetch('https://api.vega.chat/api/v1/responses', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_VEGA_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'openai/o4-mini',
    input: 'Solve this step by step: If a train travels 60 mph for 2.5 hours, how far does it go?',
    reasoning: {
      effort: 'medium'
    },
    stream: true,
    max_output_tokens: 9000,
  }),
});

const reader = response.body?.getReader();
const decoder = new TextDecoder();

while (true) {
  const { done, value } = await reader.read();
  if (done) break;

  const chunk = decoder.decode(value);
  const lines = chunk.split('\n');

  for (const line of lines) {
    if (line.startsWith('data: ')) {
      const data = line.slice(6);
      if (data === '[DONE]') return;

      try {
        const parsed = JSON.parse(data);
        if (parsed.type === 'response.reasoning.delta') {
          console.log('Reasoning:', parsed.delta);
        }
      } catch (e) {
        // Skip invalid JSON
      }
    }
  }
}
python
import requests
import json

response = requests.post(
    'https://api.vega.chat/api/v1/responses',
    headers={
        'Authorization': 'Bearer YOUR_VEGA_API_KEY',
        'Content-Type': 'application/json',
    },
    json={
        'model': 'openai/o4-mini',
        'input': 'Solve this step by step: If a train travels 60 mph for 2.5 hours, how far does it go?',
        'reasoning': {
            'effort': 'medium'
        },
        'stream': True,
        'max_output_tokens': 9000,
    },
    stream=True
)

for line in response.iter_lines():
    if line:
        line_str = line.decode('utf-8')
        if line_str.startswith('data: '):
            data = line_str[6:]
            if data == '[DONE]':
                break
            try:
                parsed = json.loads(data)
                if parsed.get('type') == 'response.reasoning.delta':
                    print(f"Reasoning: {parsed.get('delta', '')}")
            except json.JSONDecodeError:
                continue

Ответ с рассуждением

Когда рассуждение включено, ответ содержит информацию о рассуждении:

json
{
  "id": "resp_1234567890",
  "object": "response",
  "created_at": 1234567890,
  "model": "openai/o4-mini",
  "output": [
    {
      "type": "reasoning",
      "id": "rs_abc123",
      "encrypted_content": "gAAAAABotI9-FK1PbhZhaZk4yMrZw3XDI1AWFaKb9T0NQq7LndK6zaRB...",
      "summary": [
        "First, I need to determine the current year",
        "Then calculate the difference from 1995",
        "Finally, compare that to 30 years"
      ]
    },
    {
      "type": "message",
      "id": "msg_xyz789",
      "status": "completed",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Yes. In 2025, 1995 was 30 years ago. In fact, as of today (Aug 31, 2025), it's exactly 30 years since Aug 31, 1995.",
          "annotations": []
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 15,
    "output_tokens": 85,
    "output_tokens_details": {
      "reasoning_tokens": 45
    },
    "total_tokens": 100
  },
  "status": "completed"
}

Лучшие практики

  1. Выбирайте подходящие уровни усилий: используйте high для сложных задач, low — для простых.
  2. Учитывайте расход токенов: рассуждение увеличивает потребление токенов.
  3. Используйте потоковую передачу: для длинных цепочек рассуждений потоковый режим улучшает пользовательский опыт.
  4. Включайте контекст: предоставляйте достаточный контекст, чтобы модель могла эффективно рассуждать.

Следующие шаги

  • Исследуйте Tool Calling с рассуждением
  • Узнайте о интеграции Web Search
  • Ознакомьтесь с фундаментальными принципами Basic Usage