> ## Documentation Index
> Fetch the complete documentation index at: https://www.edenai.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Anthropic Message

> Anthropic Messages API — native pass-through via litellm.



## OpenAPI

````yaml /api-reference/v3-openapi.json post /v3/v1/messages
openapi: 3.1.0
info:
  title: Eden AI API V3
  version: 3.0.0
servers:
  - url: https://api.edenai.run
    description: Production server
security: []
paths:
  /v3/v1/messages:
    post:
      tags:
        - Anthropic Messages
      summary: Create Anthropic Message
      description: Anthropic Messages API — native pass-through via litellm.
      operationId: create_anthropic_message_v3_v1_messages_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnthropicMessagesBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessagesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - AuthBearer: []
components:
  schemas:
    AnthropicMessagesBody:
      properties:
        fallbacks:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 3
            - type: 'null'
          title: Fallbacks
          description: >-
            List of fallback model IDs to try if the primary model fails. Models
            are tried in order. Example: ['anthropic/claude-3-opus',
            'openai/gpt-4o']
        router_candidates:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Router Candidates
          description: >-
            List of model candidates for dynamic routing when using
            model='@edenai'. Each entry should be 'provider/model', e.g.
            ['openai/gpt-4o', 'anthropic/claude-3-5-sonnet-20241022']. If not
            provided, defaults to all available models.
        model:
          type: string
          title: Model
        messages:
          items:
            $ref: '#/components/schemas/AnthropicMessage'
          type: array
          title: Messages
        max_tokens:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Max Tokens
          default: 1024
        system:
          anyOf:
            - type: string
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: System
        temperature:
          anyOf:
            - type: number
              maximum: 2
              minimum: 0
            - type: 'null'
          title: Temperature
        top_p:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Top P
        top_k:
          anyOf:
            - type: integer
            - type: 'null'
          title: Top K
        stream:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Stream
          default: false
        stop_sequences:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Stop Sequences
        tools:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Tools
        tool_choice:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Tool Choice
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        thinking:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Thinking
        extra_headers:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Extra Headers
      additionalProperties: true
      type: object
      required:
        - model
        - messages
      title: AnthropicMessagesBody
    AnthropicMessagesResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the message.
        type:
          type: string
          const: message
          title: Type
          description: Object type. Always 'message' for this endpoint.
          default: message
        role:
          type: string
          const: assistant
          title: Role
          description: Conversational role of the response.
          default: assistant
        model:
          type: string
          title: Model
          description: Model that generated the message.
        content:
          items:
            $ref: '#/components/schemas/AnthropicContentBlock'
          type: array
          title: Content
          description: Ordered list of content blocks produced by the model.
        stop_reason:
          anyOf:
            - type: string
              enum:
                - end_turn
                - max_tokens
                - stop_sequence
                - tool_use
            - type: 'null'
          title: Stop Reason
          description: Reason generation stopped, if known.
        stop_sequence:
          anyOf:
            - type: string
            - type: 'null'
          title: Stop Sequence
          description: Custom stop sequence that triggered the stop, if any.
        usage:
          $ref: '#/components/schemas/AnthropicUsage'
          description: Token usage for the request.
      additionalProperties: true
      type: object
      required:
        - id
        - model
        - content
        - usage
      title: AnthropicMessagesResponse
      description: Response body for POST /v1/messages (non-streaming).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AnthropicMessage:
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
            - system
          title: Role
        content:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/AnthropicContentBlock'
              type: array
          title: Content
      additionalProperties: true
      type: object
      required:
        - role
        - content
      title: AnthropicMessage
    AnthropicContentBlock:
      properties:
        type:
          type: string
          title: Type
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        input:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input
        tool_use_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Use Id
        content:
          anyOf:
            - type: string
            - items: {}
              type: array
            - type: 'null'
          title: Content
        is_error:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Error
        source:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Source
        thinking:
          anyOf:
            - type: string
            - type: 'null'
          title: Thinking
        signature:
          anyOf:
            - type: string
            - type: 'null'
          title: Signature
      additionalProperties: true
      type: object
      required:
        - type
      title: AnthropicContentBlock
    AnthropicUsage:
      properties:
        input_tokens:
          type: integer
          title: Input Tokens
          description: Number of input tokens consumed.
        output_tokens:
          type: integer
          title: Output Tokens
          description: Number of output tokens generated.
        cache_creation_input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cache Creation Input Tokens
          description: Tokens written to the prompt cache (when prompt caching is used).
        cache_read_input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cache Read Input Tokens
          description: Tokens read from the prompt cache (when prompt caching is used).
      additionalProperties: true
      type: object
      required:
        - input_tokens
        - output_tokens
      title: AnthropicUsage
      description: Token usage block returned by the Anthropic Messages API.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    AuthBearer:
      type: http
      scheme: bearer

````