Compoid Messages API

The Messages API from Compoid — 2 operation(s) for messages.

GitHub OpenAPI

Operations 2

POST /v1/messages Create Messages #
POST /v1/messages/count_tokens Count Tokens #

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/compoid-com:compoid-com-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

compoid-com-messages-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Compoid Com Messages API
  version: 0.1.0
  x-refined-note:
  - x-original-title differs across the merged source definitions and was not carried
  description: 'Operations tagged Messages across 2 of this provider''s published API definitions: compoid-com-openapi.json, compoid-com-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.compoid.com
  description: Compoid AI inference host (paths carry the /v1 prefix)
tags:
- name: Messages
paths:
  /v1/messages:
    post:
      summary: Create Messages
      operationId: create_messages_v1_messages_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnthropicMessagesRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
            text/event-stream: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Messages
  /v1/messages/count_tokens:
    post:
      summary: Count Tokens
      operationId: count_tokens_v1_messages_count_tokens_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnthropicCountTokensRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicCountTokensResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Messages
components:
  schemas:
    AnthropicTool:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        input_schema:
          additionalProperties: true
          type: object
          title: Input Schema
        strict:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Strict
        defer_loading:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Defer Loading
      type: object
      required:
      - name
      - input_schema
      title: AnthropicTool
      description: Tool definition.
    AnthropicMessage:
      properties:
        role:
          type: string
          enum:
          - user
          - assistant
          - system
          title: Role
        content:
          anyOf:
          - type: string
          - items:
              $ref: '#/components/schemas/AnthropicContentBlock'
            type: array
          title: Content
      type: object
      required:
      - role
      - content
      title: AnthropicMessage
      description: Message structure.
    AnthropicCountTokensRequest:
      properties:
        model:
          type: string
          title: Model
        messages:
          items:
            $ref: '#/components/schemas/AnthropicMessage'
          type: array
          title: Messages
        output_config:
          anyOf:
          - $ref: '#/components/schemas/AnthropicOutputConfig'
          - type: 'null'
        system:
          anyOf:
          - type: string
          - items:
              $ref: '#/components/schemas/AnthropicContentBlock'
            type: array
          - type: 'null'
          title: System
        thinking:
          anyOf:
          - oneOf:
            - $ref: '#/components/schemas/AnthropicThinkingConfigEnabled'
            - $ref: '#/components/schemas/AnthropicThinkingConfigDisabled'
            - $ref: '#/components/schemas/AnthropicThinkingConfigAdaptive'
            discriminator:
              propertyName: type
              mapping:
                adaptive: '#/components/schemas/AnthropicThinkingConfigAdaptive'
                disabled: '#/components/schemas/AnthropicThinkingConfigDisabled'
                enabled: '#/components/schemas/AnthropicThinkingConfigEnabled'
          - type: 'null'
          title: Thinking
        tool_choice:
          anyOf:
          - $ref: '#/components/schemas/AnthropicToolChoice'
          - type: 'null'
        tools:
          anyOf:
          - items:
              $ref: '#/components/schemas/AnthropicTool'
            type: array
          - type: 'null'
          title: Tools
        chat_template_kwargs:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Chat Template Kwargs
          description: Additional keyword args to pass to the chat template renderer. Will be accessible by the template.
      type: object
      required:
      - model
      - messages
      title: AnthropicCountTokensRequest
      description: Anthropic messages.count_tokens request.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AnthropicErrorResponse:
      properties:
        type:
          type: string
          const: error
          title: Type
          default: error
        error:
          $ref: '#/components/schemas/AnthropicError'
      type: object
      required:
      - error
      title: AnthropicErrorResponse
      description: Error response structure for Anthropic API.
    AnthropicThinkingConfigDisabled:
      properties:
        type:
          type: string
          const: disabled
          title: Type
      type: object
      required:
      - type
      title: AnthropicThinkingConfigDisabled
    AnthropicContextManagement:
      properties:
        original_input_tokens:
          type: integer
          title: Original Input Tokens
      type: object
      required:
      - original_input_tokens
      title: AnthropicContextManagement
      description: Context management information for token counting.
    AnthropicToolChangeDefinition:
      properties:
        type:
          type: string
          const: tool_definition
          title: Type
        definition:
          $ref: '#/components/schemas/AnthropicTool'
      type: object
      required:
      - type
      - definition
      title: AnthropicToolChangeDefinition
      description: A tool defined by value in a tool_addition block.
    AnthropicToolChangeReference:
      properties:
        type:
          type: string
          const: tool_reference
          title: Type
        name:
          type: string
          title: Name
      type: object
      required:
      - type
      - name
      title: AnthropicToolChangeReference
      description: A tool named by a tool_addition or tool_removal block.
    AnthropicJsonOutputFormat:
      properties:
        schema:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Schema
        type:
          type: string
          const: json_schema
          title: Type
          default: json_schema
      type: object
      title: AnthropicJsonOutputFormat
      description: JSON output format configuration.
    AnthropicError:
      properties:
        type:
          type: string
          title: Type
        message:
          type: string
          title: Message
      type: object
      required:
      - type
      - message
      title: AnthropicError
      description: Error structure for Anthropic API.
    AnthropicToolChoice:
      properties:
        type:
          type: string
          enum:
          - auto
          - any
          - tool
          - none
          title: Type
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        disable_parallel_tool_use:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Disable Parallel Tool Use
      type: object
      required:
      - type
      title: AnthropicToolChoice
      description: Tool Choice definition.
    AnthropicCountTokensResponse:
      properties:
        input_tokens:
          type: integer
          title: Input Tokens
        context_management:
          anyOf:
          - $ref: '#/components/schemas/AnthropicContextManagement'
          - type: 'null'
      type: object
      required:
      - input_tokens
      title: AnthropicCountTokensResponse
      description: Anthropic messages.count_tokens response.
    AnthropicContentBlock:
      properties:
        type:
          type: string
          enum:
          - text
          - image
          - tool_use
          - tool_result
          - tool_reference
          - thinking
          - redacted_thinking
          - tool_addition
          - tool_removal
          title: Type
        text:
          anyOf:
          - type: string
          - type: 'null'
          title: Text
        source:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Source
        id:
          anyOf:
          - type: string
          - type: 'null'
          title: Id
        tool_use_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Tool Use Id
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        input:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Input
        content:
          anyOf:
          - type: string
          - items:
              additionalProperties: true
              type: object
            type: array
          - type: 'null'
          title: Content
        is_error:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Is Error
        tool_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Tool Name
        thinking:
          anyOf:
          - type: string
          - type: 'null'
          title: Thinking
        signature:
          anyOf:
          - type: string
          - type: 'null'
          title: Signature
        data:
          anyOf:
          - type: string
          - type: 'null'
          title: Data
        tool:
          anyOf:
          - oneOf:
            - $ref: '#/components/schemas/AnthropicToolChangeReference'
            - $ref: '#/components/schemas/AnthropicToolChangeDefinition'
            discriminator:
              propertyName: type
              mapping:
                tool_definition: '#/components/schemas/AnthropicToolChangeDefinition'
                tool_reference: '#/components/schemas/AnthropicToolChangeReference'
          - type: 'null'
          title: Tool
      type: object
      required:
      - type
      title: AnthropicContentBlock
      description: Content block in message.
    AnthropicMessagesRequest:
      properties:
        model:
          type: string
          title: Model
        messages:
          items:
            $ref: '#/components/schemas/AnthropicMessage'
          type: array
          title: Messages
        max_tokens:
          type: integer
          title: Max Tokens
        metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Metadata
        output_config:
          anyOf:
          - $ref: '#/components/schemas/AnthropicOutputConfig'
          - type: 'null'
        thinking:
          anyOf:
          - oneOf:
            - $ref: '#/components/schemas/AnthropicThinkingConfigEnabled'
            - $ref: '#/components/schemas/AnthropicThinkingConfigDisabled'
            - $ref: '#/components/schemas/AnthropicThinkingConfigAdaptive'
            discriminator:
              propertyName: type
              mapping:
                adaptive: '#/components/schemas/AnthropicThinkingConfigAdaptive'
                disabled: '#/components/schemas/AnthropicThinkingConfigDisabled'
                enabled: '#/components/schemas/AnthropicThinkingConfigEnabled'
          - type: 'null'
          title: Thinking
        stop_sequences:
          anyOf:
          - items:
              type: string
            type: array
            maxItems: 4
          - type: 'null'
          title: Stop Sequences
        stream:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Stream
          default: false
        system:
          anyOf:
          - type: string
          - items:
              $ref: '#/components/schemas/AnthropicContentBlock'
            type: array
          - type: 'null'
          title: System
        temperature:
          anyOf:
          - type: number
          - type: 'null'
          title: Temperature
        tool_choice:
          anyOf:
          - $ref: '#/components/schemas/AnthropicToolChoice'
          - type: 'null'
        tools:
          anyOf:
          - items:
              $ref: '#/components/schemas/AnthropicTool'
            type: array
          - type: 'null'
          title: Tools
        top_k:
          anyOf:
          - type: integer
          - type: 'null'
          title: Top K
        top_p:
          anyOf:
          - type: number
          - type: 'null'
          title: Top P
        mm_payload:
          type: string
          enum:
          - tensors
          - none
          title: Mm Payload
          description: What the render response's `features` carry for multimodal items. 'tensors' serializes the processed tensors into `kwargs_data` and `mm_metadata`. 'none' sets both to null for callers that need only the token layout and item hashes, such as cache-aware routers. Do not send a 'none' response to `/inference/v1/generate` which reads a null `kwargs_data` as every item being cached. Only supported on the render endpoints. Ignored on regular generation endpoints.
          default: tensors
        return_mm_kwargs:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Return Mm Kwargs
          description: 'Deprecated alias: false is the same as `mm_payload=''none''`. Ignored when `mm_payload` is set.'
          deprecated: true
        cache_salt:
          anyOf:
          - type: string
            maxLength: 1024
            minLength: 1
          - type: 'null'
          title: Cache Salt
          description: If specified, the prefix cache will be salted with the provided string to prevent an attacker to guess prompts in multi-user environments. The salt should be random, protected from access by 3rd parties, and long enough to be unpredictable (e.g., 43 characters base64-encoded, corresponding to 256 bit).
        watermarking:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Watermarking
          description: Whether to apply the engine's configured watermark to this request.
        kv_transfer_params:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Kv Transfer Params
          description: KVTransfer parameters used for disaggregated serving.
        ec_transfer_params:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Ec Transfer Params
          description: ECTransfer parameters used for encoder-cache disaggregated serving.
        vllm_xargs:
          anyOf:
          - additionalProperties:
              anyOf:
              - type: string
              - type: integer
              - type: number
              - items:
                  anyOf:
                  - type: string
                  - type: integer
                  - type: number
                type: array
            type: object
          - type: 'null'
          title: Vllm Xargs
          description: Additional request parameters with (list of) string or numeric values, used by custom extensions.
        chat_template_kwargs:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Chat Template Kwargs
          description: Additional keyword args to pass to the chat template renderer. Will be accessible by the template.
      type: object
      required:
      - model
      - messages
      - max_tokens
      title: AnthropicMessagesRequest
      description: Anthropic Messages API request.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    AnthropicOutputConfig:
      properties:
        effort:
          anyOf:
          - type: string
            enum:
            - low
            - medium
            - high
            - xhigh
            - max
          - type: 'null'
          title: Effort
        format:
          anyOf:
          - $ref: '#/components/schemas/AnthropicJsonOutputFormat'
          - type: 'null'
      type: object
      title: AnthropicOutputConfig
      description: Configuration options for the model's output, such as the output format.
    AnthropicThinkingConfigAdaptive:
      properties:
        type:
          type: string
          const: adaptive
          title: Type
        display:
          anyOf:
          - type: string
            enum:
            - summarized
            - omitted
            - updates
          - type: 'null'
          title: Display
      type: object
      required:
      - type
      title: AnthropicThinkingConfigAdaptive
      description: 'Extended thinking whose depth the model chooses.


        ``display`` is accepted but ignored: reasoning is always returned.'
    AnthropicThinkingConfigEnabled:
      properties:
        type:
          type: string
          const: enabled
          title: Type
        budget_tokens:
          type: integer
          minimum: 1024.0
          title: Budget Tokens
        display:
          anyOf:
          - type: string
            enum:
            - summarized
            - omitted
            - updates
          - type: 'null'
          title: Display
      type: object
      required:
      - type
      - budget_tokens
      title: AnthropicThinkingConfigEnabled
      description: 'Extended thinking with a fixed token budget.


        ``display`` is accepted but ignored: reasoning is always returned.'
x-refined-from:
- compoid-com-openapi.json
- compoid-com-openapi.yml