How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Claude Messages API

Create messages and count tokens

Claude Messages API is one of 9 APIs that Claude publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

This API exposes 34 JSON Schema definitions.

Tagged areas include Message. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, authentication docs, pricing, rate-limit docs, a getting-started guide, and 34 JSON Schemas.

This API exposes 2 operations across 2 paths, and defines 24 schemas. It is described by OpenAPI 3.2.0, at version 2023-06-01.

Requests are made against a single base URL, https://api.anthropic.com/v1.

2 operations 2 paths 24 schemas 2 POST

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.2.0
API Version
2023-06-01
Base URL
https://api.anthropic.com/v1
Authentication
API Key
Terms of Service
Resource Areas
1

Authentication & Security 1

Claude Messages API declares 1 security scheme for authenticating requests. An API key is passed in the header as x-api-key (ApiKeyAuth). By default, every request must be authenticated.

  • ApiKeyAuth — API key for authenticating requests. Obtain from the Anthropic Console at https://console.anthropic.com

Paths & Operations 2

Across 2 paths, the API surfaces 2 operations — 2 POST. Each is listed below with its method, path, parameters, and response codes.

Messages 2

Create messages and count tokens

POST
/messages
Create a Message
createMessage 2 params body → 200400401403404429500529
POST
/messages/count_tokens
Count Message Tokens
countMessageTokens 2 params body → 200400401429500

Schemas 24

The contract defines 24 schemas that model the data the API accepts and returns. The most detailed are CreateMessageRequest (16 properties), Message (8 properties), DocumentBlockParam (6 properties), Tool (5 properties). Each schema is shown below with its type and property counts.

ContentBlockParam
A content block in a message request.
Tool
object
Definition of a tool that the model can use.
5 properties 2 required
Message
object
A message response from Claude.
8 properties 7 required
Error
object
An error response from the API.
2 properties 2 required
ThinkingConfig
object
Configuration for extended thinking.
2 properties 1 required
ThinkingBlock
object
A thinking content block showing Claude's internal reasoning process.
3 properties 3 required
ToolUseBlockParam
object
A tool use content block in a request (for multi-turn tool use).
5 properties 4 required
CacheControl
object
Cache control settings for prompt caching.
2 properties 1 required
TextBlock
object
A text content block in a response.
3 properties 2 required
ImageBlockParam
object
An image content block. Supports base64-encoded or URL-referenced images.
3 properties 2 required
TokenCount
object
1 property
ToolChoice
object
How the model should use the provided tools.
3 properties 1 required
ToolUseBlock
object
A tool use content block in a response, indicating the model wants to use a tool.
4 properties 4 required
ThinkingBlockParam
object
A thinking content block in a request (for multi-turn with extended thinking).
3 properties 3 required
Usage
object
Token usage information for the request.
4 properties 2 required
OutputConfig
object
Configuration for structured output format.
2 properties
Metadata
object
Request metadata for tracking and abuse prevention.
1 property
ToolResultBlockParam
object
A tool result content block, providing the output from a tool invocation.
5 properties 2 required
TextBlockParam
object
A text content block in a request.
3 properties 2 required
DocumentBlockParam
object
A document content block for PDFs and text documents.
6 properties 2 required
MessageParam
object
An input message in the conversation.
2 properties 2 required
CountTokensRequest
object
5 properties 2 required
ContentBlock
A content block in a message response.
CreateMessageRequest
object
16 properties 3 required

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

claude-messages-api-openapi.yml Raw ↑

Other APIs Claude publishes across the network.

Claude Message Batches API
Claude Models API
Claude Files API
Claude Admin API
Claude Usage and Cost API
Claude Text Completions API
Claude Message Batches API
Claude Models API
Where this information came from

This is an independent, third-party profile of Claude Messages API, published by API Evangelist. We do not operate, host, resell, or support these APIs, and we are not affiliated with or endorsed by the company unless stated above. Everything here is built from publicly available information — the company's own site, developer portal, documentation, public repositories, and the specifications it publishes for public use. Nothing is obtained by breaching a system, defeating an access control, or using credentials.

The Kin Score and Agent Readiness rating are independently calculated assessments of a company's public API artifacts, scored against a published rubric. They are not certifications, endorsements, security assessments, or audits.

Corrections, re-scores, and removal are free — no partnership or purchase required, and you do not need to justify the request. A removed company is recorded as unrated, never scored zero for having asked. Acknowledgement within one business day; removal within two.

info@apievangelist.com · Read the full data-sourcing policy →
On a security or compliance team? Put security in the subject line and you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.