Hubris Messages API

The Messages API from Hubris — 1 operation(s) for messages.

GitHub OpenAPI

Operations 1

POST /v1/messages Создать сообщение (Anthropic Messages API) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/hubris-pw:hubris-pw-messages-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

hubris-pw-messages-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Hubris Messages API
  version: 1.0.0
  description: 'OpenAI-совместимый API российского LLM-агрегатора. Все цены в рублях.


    Версии и вывод из эксплуатации (deprecation policy): несовместимые изменения — только в новой версии префикса (`/v2`); об отключении эндпоинта или поля предупреждаем не меньше чем за 90 дней заголовками `Deprecation` (RFC 9745) и `Sunset` (RFC 8594), записью в журнале изменений и письмом. Подробно: https://hubris.pw/docs/api/versioning'
servers:
- url: https://api.hubris.pw
  description: Production
tags:
- name: Messages
paths:
  /v1/messages:
    post:
      operationId: createMessage
      tags:
      - Messages
      summary: Создать сообщение (Anthropic Messages API)
      description: 'Anthropic-совместимый endpoint. Принимает как Anthropic-имена моделей

        (`claude-sonnet-4-5`, `claude-3-5-sonnet-20241022`, `claude-haiku-4-5-latest`),

        так и каноничные (`anthropic/claude-sonnet-4.6`). Поддерживает Bearer и

        x-api-key заголовки. Используется Claude Code и любыми Anthropic SDK

        через `ANTHROPIC_BASE_URL=https://api.hubris.pw`.


        При `stream: true` — Server-Sent Events в нативном Anthropic-формате

        (`message_start` / `content_block_*` / `message_delta` / `message_stop`).


        Privacy Mode на этом эндпоинте не поддерживается. Для маскирования PII

        используйте `/v1/chat/completions`.'
      security:
      - bearerAuth: []
      - oauth2:
        - chat:write
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnthropicMessagesRequest'
      responses:
        '200':
          description: 'Успешный ответ. При `stream: false` — JSON. При `stream: true` — `text/event-stream`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessagesResponse'
            text/event-stream:
              schema:
                type: string
                description: Anthropic SSE-stream events (см. /docs/api/messages).
        '400':
          description: Невалидное тело
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessagesError'
        '401':
          description: Невалидный API-ключ
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessagesError'
        '402':
          description: Недостаточно средств
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessagesError'
        '404':
          description: Модель не найдена
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessagesError'
        '429':
          description: Превышен дневной лимит ключа
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessagesError'
        '502':
          description: Ошибка провайдера
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessagesError'
        '503':
          description: Курс ЦБ РФ недоступен
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessagesError'
        '504':
          description: Провайдер не ответил вовремя
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessagesError'
components:
  schemas:
    AnthropicMessagesError:
      type: object
      properties:
        type:
          type: string
          enum:
          - error
        error:
          type: object
          properties:
            type:
              $ref: '#/components/schemas/AnthropicErrorType'
            message:
              type: string
          required:
          - type
          - message
      required:
      - type
      - error
    AnthropicTextBlock:
      type: object
      properties:
        type:
          type: string
          enum:
          - text
        text:
          type: string
        cache_control:
          $ref: '#/components/schemas/AnthropicCacheControl'
        citations:
          type: array
          items:
            type: object
            additionalProperties:
              nullable: true
      required:
      - type
      - text
    AnthropicContentBlock:
      anyOf:
      - $ref: '#/components/schemas/AnthropicTextBlock'
      - $ref: '#/components/schemas/AnthropicImageBlock'
      - $ref: '#/components/schemas/AnthropicToolUseBlock'
      - $ref: '#/components/schemas/AnthropicToolResultBlock'
      - $ref: '#/components/schemas/AnthropicDocumentBlock'
      - $ref: '#/components/schemas/AnthropicThinkingBlock'
      - $ref: '#/components/schemas/AnthropicRedactedThinkingBlock'
      - type: object
        properties:
          type:
            type: string
        required:
        - type
    AnthropicTool:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[a-zA-Z0-9_-]+$
        description:
          type: string
        input_schema:
          type: object
          additionalProperties:
            nullable: true
        cache_control:
          $ref: '#/components/schemas/AnthropicCacheControl'
        type:
          type: string
      required:
      - name
      - input_schema
    AnthropicErrorType:
      type: string
      enum:
      - invalid_request_error
      - authentication_error
      - permission_error
      - not_found_error
      - request_too_large
      - rate_limit_error
      - api_error
      - overloaded_error
      - billing_error
      - timeout_error
    AnthropicThinkingBlock:
      type: object
      properties:
        type:
          type: string
          enum:
          - thinking
        thinking:
          type: string
        signature:
          type: string
      required:
      - type
      - thinking
    AnthropicSystem:
      anyOf:
      - type: string
      - type: array
        items:
          $ref: '#/components/schemas/AnthropicTextBlock'
      description: Системный промпт. Строка или массив text-блоков (для гибкого cache_control).
    AnthropicDocumentBlock:
      type: object
      properties:
        type:
          type: string
          enum:
          - document
        source:
          type: object
          additionalProperties:
            nullable: true
        title:
          type: string
        context:
          type: string
        citations:
          type: object
          additionalProperties:
            nullable: true
        cache_control:
          $ref: '#/components/schemas/AnthropicCacheControl'
      required:
      - type
      - source
    AnthropicCacheControl:
      type: object
      properties:
        type:
          type: string
          enum:
          - ephemeral
        ttl:
          type: string
          enum:
          - 5m
          - 1h
      required:
      - type
    AnthropicImageBlock:
      type: object
      properties:
        type:
          type: string
          enum:
          - image
        source:
          anyOf:
          - type: object
            properties:
              type:
                type: string
                enum:
                - base64
              media_type:
                type: string
                enum:
                - image/jpeg
                - image/png
                - image/gif
                - image/webp
              data:
                type: string
            required:
            - type
            - media_type
            - data
          - type: object
            properties:
              type:
                type: string
                enum:
                - url
              url:
                type: string
                format: uri
            required:
            - type
            - url
        cache_control:
          $ref: '#/components/schemas/AnthropicCacheControl'
      required:
      - type
      - source
    AnthropicMessage:
      type: object
      properties:
        role:
          type: string
          enum:
          - user
          - assistant
          - system
        content:
          anyOf:
          - type: string
          - type: array
            items:
              $ref: '#/components/schemas/AnthropicContentBlock'
      required:
      - role
      - content
    AnthropicToolUseBlock:
      type: object
      properties:
        type:
          type: string
          enum:
          - tool_use
        id:
          type: string
        name:
          type: string
        input:
          nullable: true
        cache_control:
          $ref: '#/components/schemas/AnthropicCacheControl'
      required:
      - type
      - id
      - name
    AnthropicToolResultBlock:
      type: object
      properties:
        type:
          type: string
          enum:
          - tool_result
        tool_use_id:
          type: string
        content:
          anyOf:
          - type: string
          - type: array
            items:
              anyOf:
              - $ref: '#/components/schemas/AnthropicTextBlock'
              - $ref: '#/components/schemas/AnthropicImageBlock'
        is_error:
          type: boolean
        cache_control:
          $ref: '#/components/schemas/AnthropicCacheControl'
      required:
      - type
      - tool_use_id
    AnthropicMessagesResponse:
      type: object
      properties:
        id:
          type: string
          example: msg_01XYZ
        type:
          type: string
          enum:
          - message
        role:
          type: string
          enum:
          - assistant
        content:
          type: array
          items:
            $ref: '#/components/schemas/AnthropicContentBlock'
        model:
          type: string
        stop_reason:
          $ref: '#/components/schemas/AnthropicStopReason'
        stop_sequence:
          type: string
          nullable: true
        usage:
          $ref: '#/components/schemas/AnthropicResponseUsage'
        container:
          nullable: true
      required:
      - id
      - type
      - role
      - content
      - model
      - stop_reason
      - stop_sequence
      - usage
    AnthropicServerTool:
      type: object
      properties:
        type:
          type: string
          pattern: ^[a-z_]+_\d{8}$
        name:
          type: string
          minLength: 1
          maxLength: 128
        max_uses:
          type: integer
          minimum: 0
          exclusiveMinimum: true
        allowed_domains:
          type: array
          items:
            type: string
        blocked_domains:
          type: array
          items:
            type: string
        user_location:
          type: object
          additionalProperties:
            nullable: true
        cache_control:
          $ref: '#/components/schemas/AnthropicCacheControl'
      required:
      - type
      - name
    AnthropicToolChoice:
      anyOf:
      - type: object
        properties:
          type:
            type: string
            enum:
            - auto
          disable_parallel_tool_use:
            type: boolean
        required:
        - type
      - type: object
        properties:
          type:
            type: string
            enum:
            - any
          disable_parallel_tool_use:
            type: boolean
        required:
        - type
      - type: object
        properties:
          type:
            type: string
            enum:
            - tool
          name:
            type: string
          disable_parallel_tool_use:
            type: boolean
        required:
        - type
        - name
      - type: object
        properties:
          type:
            type: string
            enum:
            - none
        required:
        - type
    AnthropicResponseUsage:
      type: object
      properties:
        input_tokens:
          type: integer
          minimum: 0
        output_tokens:
          type: integer
          minimum: 0
        cache_creation_input_tokens:
          type: integer
          nullable: true
          minimum: 0
        cache_read_input_tokens:
          type: integer
          nullable: true
          minimum: 0
        cache_creation:
          nullable: true
        service_tier:
          type: string
          nullable: true
        server_tool_use:
          nullable: true
      required:
      - input_tokens
      - output_tokens
    AnthropicStopReason:
      type: string
      nullable: true
      enum:
      - end_turn
      - max_tokens
      - stop_sequence
      - tool_use
      - pause_turn
      - refusal
    AnthropicMessagesRequest:
      type: object
      properties:
        model:
          type: string
          minLength: 1
          description: Имя модели. Принимаются и Anthropic-имена (`claude-sonnet-4-5`, `claude-3-5-sonnet-20241022`, `claude-haiku-4-5-latest`), и каноничные OR-имена (`anthropic/claude-sonnet-4.6`). См. /docs/integrations/claude-code.
          example: claude-sonnet-4-5
        models:
          type: array
          items:
            type: string
            minLength: 1
          minItems: 1
          maxItems: 10
          description: Список резервных моделей (расширение Hubris). Если `model` отвечает 429/5xx или не начинает ответ вовремя — запрос уходит к следующей по порядку. Модель, не принимающая содержимое запроса (картинки, документы), пропускается. Биллинг по фактически ответившей модели.
          example:
          - claude-opus-4-1
          - anthropic/claude-sonnet-4.6
        max_tokens:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: Максимальное число токенов в ответе. Обязательное поле.
          example: 1024
        messages:
          type: array
          items:
            $ref: '#/components/schemas/AnthropicMessage'
          minItems: 1
          description: Массив сообщений диалога. Чередование ролей user/assistant.
        system:
          $ref: '#/components/schemas/AnthropicSystem'
        metadata:
          type: object
          properties:
            user_id:
              type: string
        stop_sequences:
          type: array
          items:
            type: string
        stream:
          type: boolean
        temperature:
          type: number
          minimum: 0
          maximum: 1
        top_p:
          type: number
          minimum: 0
          maximum: 1
        top_k:
          type: integer
          minimum: 0
          exclusiveMinimum: true
        tools:
          type: array
          items:
            anyOf:
            - $ref: '#/components/schemas/AnthropicServerTool'
            - $ref: '#/components/schemas/AnthropicTool'
        tool_choice:
          $ref: '#/components/schemas/AnthropicToolChoice'
        thinking:
          type: object
          properties:
            type:
              type: string
              enum:
              - enabled
              - disabled
              - adaptive
            budget_tokens:
              type: integer
              minimum: 0
          required:
          - type
          description: Extended thinking (Claude 4+). enabled + budget_tokens — бюджет на размышления; adaptive — режим Claude 5.
        service_tier:
          type: string
      required:
      - model
      - max_tokens
      - messages
    AnthropicRedactedThinkingBlock:
      type: object
      properties:
        type:
          type: string
          enum:
          - redacted_thinking
        data:
          type: string
      required:
      - type
      - data
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sk-gw-...
      description: API-ключ в формате `sk-gw-` + 32 hex. Создаётся в дашборде на /keys. Обычный ключ даёт все права, ключ только для чтения не может тратить баланс.
    oauth2:
      type: oauth2
      description: 'OAuth-токен приложения с ограниченными правами. Регистрация клиента — `POST /oauth/clients` (RFC 7591), PKCE S256 обязателен. Метаданные: `/.well-known/oauth-authorization-server`, `/.well-known/oauth-protected-resource`.'
      flows:
        authorizationCode:
          authorizationUrl: https://api.hubris.pw/oauth/authorize
          tokenUrl: https://api.hubris.pw/oauth/token
          refreshUrl: https://api.hubris.pw/oauth/token
          scopes:
            chat:write: 'Запросы к моделям от имени пользователя (списывают баланс): чат, Responses, Messages, эмбеддинги, реранкеры, модели решений, изображения, распознавание и озвучка речи, расшифровка видео; коннекторы Битрикс24.'
            models:read: Видеть цепочки резервных моделей пользователя в `GET /v1/models`.
            balance:read: Видеть остаток баланса пользователя.
            videos:write: Создавать видео от имени пользователя (`POST /v1/videos`, резервирует и списывает баланс).
            videos:read: Узнавать статус и скачивать видео пользователя (`GET /v1/videos/{id}`, `GET /v1/videos/{id}/content`).
            offline_access: Выдать refresh-токен, чтобы подключение жило 90 дней без повторного входа.