osmAPI Messages API

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

Operations 1

POST /messages Create a message #

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/osmapi-messages-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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

osmapi-messages-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: osmAPI Anthropic Chat Messages API
  description: Anthropic-compatible messages endpoint routed through osmAPI's unified AI gateway. Supports the native Anthropic message format including system prompts, extended thinking, tool use, and streaming.
  version: 1.0.0
  contact:
    name: osmAPI
    url: https://www.osmapi.com/
servers:
- url: https://api.osmapi.com/v1
  description: Production
security:
- bearerAuth: []
tags:
- name: Messages
paths:
  /messages:
    post:
      operationId: createMessage
      summary: Create a message
      description: Sends a message request using the Anthropic-compatible format through osmAPI's smart routing system.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageRequest'
      responses:
        '200':
          description: Successful message response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Messages
components:
  schemas:
    MessageRequest:
      type: object
      required:
      - model
      - messages
      - max_tokens
      properties:
        model:
          type: string
          description: The model identifier
          examples:
          - claude-3-5-sonnet-20241022
        messages:
          type: array
          items:
            type: object
            required:
            - role
            - content
            properties:
              role:
                type: string
                enum:
                - user
                - assistant
                - tool
                - function
              content:
                oneOf:
                - type: string
                - type: array
                  items:
                    type: object
          description: Conversation message history
        max_tokens:
          type: integer
          minimum: 1
          description: Maximum tokens to generate
        system:
          oneOf:
          - type: string
          - type: array
            items:
              type: object
          description: System instructions
        temperature:
          type: number
          minimum: 0
          maximum: 1
          description: Sampling temperature
        tools:
          type: array
          items:
            type: object
          description: Available tools for model use
        stream:
          type: boolean
          default: false
          description: Enable response streaming
        tool_choice:
          type: object
          description: Tool selection preferences
        stop_sequences:
          type: array
          items:
            type: string
          description: Custom stop text sequences
        top_p:
          type: number
          minimum: 0
          maximum: 1
          description: Nucleus sampling parameter
        top_k:
          type: integer
          description: Top-k sampling parameter
        thinking:
          type: object
          description: Extended thinking configuration
        metadata:
          type: object
          description: Request context metadata
        service_tier:
          type: string
          description: Service tier specification
    MessageResponse:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          const: message
        role:
          type: string
          const: assistant
        model:
          type: string
        content:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              text:
                type: string
              thinking:
                type: string
        stop_reason:
          type: string
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
            output_tokens:
              type: integer
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token using osmAPI key (osmint_XXXXXXXXXXXXXXXX)