API Doc-CometAPI
HomeDashBoardModel Marketplace
HomeDashBoardModel Marketplace
Discord_Support
  1. šŸ’¬ Text Models
  • How to Use CometAPI?
  • šŸš€ Overview
    • Quick Start
    • Important Guidelines
    • Release Notes
    • Quickly request CometAPI via ApiDog
    • Models
  • šŸ’¬ Text Models
    • Chat Completions
      POST
    • Responses
      POST
    • Anthropic Messages
      POST
    • Gemini Generating Content
      POST
    • Embeddings
      POST
  • šŸ–¼ļø Image Models
    • OpenAI
      • gpt-4o-image generates image
      • Images
      • Image Editing (gpt-image-1)
    • Gemini
      • Guide to calling gemini-3-pro-image (Nano Banana)
      • Gemini generates image
    • Midjourney
      • Midjourney API Quick Start
      • Task Fetching API
        • List by Condition
        • Fetch Single Task (most recommended)
      • Imagine
      • Submit Video
      • Submit Editor
      • Action (UPSCALE; VARIATION; REROLL; ZOOM, etc.)
      • Blend (image -> image)
      • Describe (image -> text)
      • Modal (Area Redesign & Zoom)
    • Replicate(image)
      • Create Predictions - General
      • replicate query
    • seededit/seedream
      • bytedance-image-generation(seedream)
      • bytedance-Image Editing (seededit)
    • bria
      • Generate Image
      • Generate Vector Graphics - Base (Beta)
      • Image Editing
      • Query Status
    • Flux(images)
      • flux generate image
      • flux query
    • Hunyuan3D
  • šŸ“ŗ Video Models
    • sora-2
      • official
        • Create video
        • Remix video
        • Retrieve video
        • Retrieve video content
      • self-developed
        • Create video
        • Retrieve video
    • veo3
      • self-developed
        • Veo3 Async Generation
        • Veo3 Retrive
    • kling (video)
      • callback_url
      • Multimodal Video Editing
        • Initialize Video for Editing
        • Add Video Selection
        • Delete Video Selection
        • Clear Video Selection
        • Preview Selected Video Area
        • Create Task
      • Text to Video
      • Image to Video
      • Multi-Image To Video
      • Video Extension
      • Avatar
      • Lip-Sync
      • [Counterpart] Creating Tasks
      • Video Effects
      • Text to Audio
      • Video to Audio
      • TTS
      • Image Generation
      • Multi-Image to Image
      • Image Expansion
      • Image Recognize
      • Virtual Try-On
      • Individual queries
    • runway(video)
      • official format
        • runway images raw video
        • Generate a video from a video
        • Generate an image from text
        • Upscale a video
        • Control a character
        • runway to get task details
      • Reverse Format
        • generate(text)
        • generate(Reference images)
        • Video to Video Style Redraw
        • Act-one Expression Migration
        • feed-get task
    • bytedance
      • bytedance-video
      • bytedance-video get
    • MiniMax Conch(video)
      • MiniMax Conch Official Documentation
      • MiniMax Conch Generation
      • MiniMax Conch Query
      • MiniMax Conch Download
    • openai-format
  • šŸ”Š Audio Models
    • Realtime
    • Create speech
    • Create transcription
    • Create translation
  • 🧩 Integration Guides
    • CodeX
    • LiteLLM
    • Dify
    • Make
    • n8n
    • Lobe-Chat
    • COZE
    • Zapier
    • Activepieces
    • LlamaIndex
    • Continue
    • FlowiseAI
    • Chatbox
    • CherryStudio
    • AnythingLLM
    • LangChain
    • BuildShip
    • gptme
    • Immersive Translation
    • Cline
    • Eudic Translation
    • ChatHub
    • OpenAI Translator
    • ChatAll Translation
    • Pot Translation
    • Zotero
    • NEXT CHAT (ChatGPT Next Web)
    • Obsidian's Text Generator Plugin
    • librechat
    • utools-ChatGPT Friend
    • avante.nvim
    • Open WebUI
    • GPT Academic Optimization (gpt_academic)
    • OpenManus
    • IntelliJ Translation Plugin
    • FastGPT
    • n8n Local Deployment
  • āš ļø Errors
    • Error Codes & Handling
  • šŸ“ Code Examples
    • Text-to-Image Generation
    • Image-to-image generation URL upload
    • Regular Post Text Conversation
    • OpenAI Official Library Usage Example
    • Streamed Output
    • Json Fixed Format Output Code Display
    • Embedding code example
    • o1-preview Model Code Example
    • LangChain Usage Example (Successful Test Date: 2024-11-25)
    • Openai dall-e-3 & flux series drawing model
    • gpt, claude, gemini multimodal network image parsing example
    • Multimodal PDF File Parsing Examples for GPT, Claude, and Gemini
    • Code example
  • šŸ„šŸ¼ā€ā™€ļø Best Practices
    • Retry Logic Documentation for CometAPI and OpenAI Official API
    • Runway Best Practices
    • Gemini CLI Installation and Usage Guide
    • Codex Usage Guide
    • CometAPI Account Balance Query API Usage Instructions
    • Midjourney Best Practices
    • Claude Code Installation and Usage Guide
  • šŸ’³ Pricing & Billing
    • About Pricing
  • šŸ¤šŸ¼ Support
    • Help Center
    • Interface Stability
    • Privacy policy
    • Terms of service
    • Common Misconceptions
    • Confusion about use
HomeDashBoardModel Marketplace
HomeDashBoardModel Marketplace
Discord_Support
  1. šŸ’¬ Text Models

Anthropic Messages

POST
https://api.cometapi.com/v1/messages
Maintainer:Not configured

Overview#

The anthropic messages format supports sending a structured list of input messages containing text and/or image content, and the model will generate the next message in the conversation. The Messages API can be used for single queries or stateless multi-turn conversations. This endpoint only supports Claude models. Please view all supported models in Model List and Pricing.

Important Notes#

āš ļø Claude Models Only
This endpoint exclusively supports Claude models. For other models (GPT, Gemini, etc.), please use the Chat Completions endpoint.
āš ļø Extended Thinking
When using thinking parameter, the minimum budget is 1,024 tokens. Extended thinking tokens count towards your max_tokens limit.

Reference Documentation#

For detailed usage and parameters of this interface, please refer to the Anthropic Official Documentation.
Claude API Guides:
Prompt Caching - Cache prompt prefixes to reduce costs and latency
Extended Thinking - Enable Claude's step-by-step reasoning
Streaming - Stream responses using Server-Sent Events
Web Fetch Tool - Fetch content from URLs
Web Search Tool - Search the web for information

Request

Header Params

Body Params application/json

Examples

Responses

🟢200Successful Response
application/json
Body

Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'https://api.cometapi.com/v1/messages' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
  "max_tokens": 1024,
  "system": "You are a helpful assistant.",
  "messages": [
    {
      "content": "Hello, world",
      "role": "user"
    }
  ],
  "model": "claude-sonnet-4-5-20250929"
}'
Response Response Example
{
    "id": "chatcmpl-a1568ee22c7a4f31848f3dc16c2f3",
    "type": "message",
    "role": "assistant",
    "content": [
        {
            "type": "text",
            "text": "Hello! It's nice to meet you. I'm Claude, an AI assistant. How can I help you today? Feel free to ask me anything you'd like - I'm happy to assist with a wide range of topics and tasks."
        }
    ],
    "model": "claude-3-5-sonnet-20240620",
    "stop_reason": "end_turn",
    "stop_sequence": null,
    "usage": {
        "input_tokens": 3,
        "output_tokens": 52,
        "cache_creation_input_tokens": 0,
        "cache_read_input_tokens": 0
    }
}
Modified atĀ 2026-01-20 09:40:03
Previous
Responses
Next
Gemini Generating Content
Built with