ZvenoAI
API Reference

Responses

POST
/v1/responses

Создает response запрос к LLM-модели через OpenAI Responses API. Совместим с OpenAI Responses API — можно использовать любой OpenAI SDK, указав base_url: "https://api.zveno.ai/v1".

Поддерживает:

  • Текстовый, массивный и multi-turn input
  • Обычный и streaming (stream: true) режимы
  • Function calling / tool use
  • Structured output (JSON schema)
  • Reasoning (extended thinking)
  • Multi-turn conversations (previous_response_id)
  • Мульти-модельный fallback (models: [...])
  • Настройки выбора провайдера (provider)

Модель указывается в формате vendor/model (например, openai/gpt-4o, anthropic/claude-sonnet-4-20250514).

Аутентификация: Authorization: Bearer <api-key>.

Authorization

BearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:8080/v1/responses" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "object": "string",
  "created_at": 0,
  "status": "string",
  "model": "string",
  "output": [
    {
      "type": "string",
      "id": "string",
      "status": "string",
      "role": "string",
      "content": [
        {
          "type": "string",
          "text": "string",
          "annotations": [
            null
          ]
        }
      ],
      "call_id": "string",
      "name": "string",
      "arguments": "string",
      "summary": [
        {
          "type": "string",
          "text": "string",
          "annotations": [
            null
          ]
        }
      ],
      "result": "string"
    }
  ],
  "output_text": "string",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "total_tokens": 0,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens_details": {
      "reasoning_tokens": 0
    }
  },
  "error": {
    "code": "string",
    "message": "string"
  },
  "incomplete_details": {
    "reason": "string"
  },
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "temperature": 0.1,
  "top_p": 0.1,
  "max_output_tokens": 0
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}

Create Image Generation POST

Синхронно генерирует изображения. stream=true отдаёт SSE image_generation.* events на том же route.

Messages POST

Создает запрос к LLM-модели через Anthropic Messages API. Совместим с Anthropic SDK и Claude Code — можно использовать любой Anthropic SDK, указав `base_url: "https://api.zveno.ai"`. Поддерживает: - Обычный и streaming (`stream: true`) режимы - Tool use (function calling) - Vision (изображения в сообщениях) - Extended thinking - Prompt caching (`cache_control`) - Computer use tools - Автоматический failover между провайдерами Модель указывается в формате `vendor/model` (например, `anthropic/claude-sonnet-4-20250514`). Аутентификация: `Authorization: Bearer <api-key>` или `x-api-key: <api-key>`. Заголовок `x-api-key` автоматически нормализуется для совместимости с Claude Code и Anthropic SDK. Тело запроса проксируется к провайдеру без конвертации формата, единственное преобразование — замена поля `model` на provider-specific ID. Ошибки возвращаются в формате Anthropic: `{"type": "error", "error": {"type": "<error_type>", "message": "<message>"}}`.