聚合API接口文档
  1. Anthropic原生格式
聚合API接口文档
  • 常用请求
    • 获取模型
      • 获取模型
      • 获取模型 - gemini
    • 文本嵌入
      • 文本嵌入
      • 文本嵌入 - gemini
    • 令牌余额查询
      GET
    • 基本请求
      POST
    • 流式请求
      POST
    • 连续对话
      POST
    • 识图请求 - url
      POST
    • 识图请求 - base64
      POST
    • 工具(函数)调用
      POST
    • 文档重排序
      POST
    • 流式出图/视频
      POST
    • gpt-5.1开思考显示
      POST
    • codex模型请求
      POST
    • chat兼容思考显示
      POST
    • 视频识别
      POST
    • PDF识别
      POST
    • 结构化输出
      POST
  • 图片/视频生成
    • OpenAI chat格式
      • 流式出图/视频(推荐)
      • 流式出图/视频 - 带图生成
    • Google 生图 - nano banana
      • Google Gemini生图
      • Google Gemini改图
      • Google Gemini生图 流式
    • OpenAI image格式
      • 生成图像
      • 编辑图像
    • OpenAI sora格式
      • 创建视频
      • 获取视频任务状态
      • 获取视频内容
    • Midjourney绘图
      • 任务提交
        • 文生图 - Imagine
        • 关联按钮动作 - Action
        • 图生文 - Describe
        • 图像混合 - Blend
        • 局部重绘 - Modal
      • 任务查询
        • 多任务查询 - ListByCondition
        • 单任务查询 - FetchFromTask
        • Seed查询 - ImageSeed
  • 音频转录
    • 音频转录
    • 音频翻译
    • 文本转语音
    • Gemini 生成音频(TTS)
  • 高阶用法
    • Gemini原生格式
      • 普通对话
      • 开启思考
      • 流式请求
      • 结构化输出
      • 函数调用
      • PDF识别
      • 图像识别
      • 视频识别
    • Anthropic原生格式
      • 普通对话
        POST
      • 流式请求
        POST
      • 开启思考
        POST
      • 图像识别
        POST
      • 函数调用
        POST
      • 内置联网
        POST
    • 对话完整传参示例
      • OpenAI对话格式 - chat
      • OpenAI对话格式 - responses
      • Claude对话格式 - messages
      • Gemini对话格式 - v1beta
  • 在代码工具使用
    • 在codex中使用
    • 在gemini cli中使用
    • 在claudecode中使用
  • 数据模型
    • Schemas
      • ErrorResponse
      • ModelsResponse
      • GeminiModelsResponse
      • ChatCompletionRequest
      • ChatCompletionResponse
      • CompletionRequest
      • CompletionResponse
      • ResponsesRequest
      • ResponsesResponse
      • ClaudeRequest
      • ClaudeResponse
      • EmbeddingRequest
      • EmbeddingResponse
      • ImageGenerationRequest
      • ImageResponse
      • AudioTranscriptionResponse
      • SpeechRequest
      • RerankRequest
      • RerankResponse
      • VideoRequest
      • ModerationRequest
      • VideoResponse
      • ModerationResponse
      • VideoTaskResponse
      • GeminiRequest
      • GeminiResponse
      • OpenAIVideoError
      • Model
      • Message
      • MessageContent
      • ToolCall
      • Tool
      • ResponseFormat
      • Usage
      • ClaudeMessage
      • VideoTaskMetadata
      • VideoTaskError
      • ChatCompletionStreamResponse
      • ResponsesStreamResponse
      • ImageEditRequest
      • AudioTranscriptionRequest
      • AudioTranslationRequest
      • OpenAIVideo
  1. Anthropic原生格式

图像识别

POST
{{url}}/v1/messages
最后修改时间:2025-11-29 15:52:05

请求参数

Header 参数

Body 参数application/json

示例
{
    "model": "claude-sonnet-4-5-20250929",
    "max_tokens": 1024,
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "image",
                    "source": {
                        "type": "base64",
                        "media_type": "image/jpeg",
                        "data": "/9j/4AAQSkZJRg..."
                    }
                },
                {
                    "type": "text",
                    "text": "What is in this image?"
                }
            ]
        }
    ]
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'http://api.example.com/v1/messages' \
--header 'x-api-key: sk-xxx' \
--header 'anthropic-version: 2023-06-01' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "claude-sonnet-4-5-20250929",
    "max_tokens": 1024,
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "image",
                    "source": {
                        "type": "base64",
                        "media_type": "image/jpeg",
                        "data": "/9j/4AAQSkZJRg..."
                    }
                },
                {
                    "type": "text",
                    "text": "What is in this image?"
                }
            ]
        }
    ]
}'

返回响应

🟢200成功
application/json
Body

示例
{
    "model": "claude-sonnet-4-5-20250929",
    "id": "msg_0138gU49SSccK4B99TSu9QJK",
    "type": "message",
    "role": "assistant",
    "content": [
        {
            "type": "text",
            "text": "This appears to be an aerial/satellite view of agricultural land showing a patchwork of farm fields. The image displays:\n\n1. **Contour farming patterns** - The curved, striped patterns following the natural topography of the land to prevent erosion\n2. **Multiple agricultural plots** with different colors indicating various crops or stages of cultivation\n3. **Wind turbines** - Several white wind turbines are visible in the center and lower portions of the image\n4. **A small settlement** - There appears to be a cluster of buildings (likely a village or small town) in the upper left corner with reddish-brown roofs\n5. **Field boundaries and access roads** connecting different parcels of land\n6. **Varying vegetation** - Different shades of green, brown, and darker tones suggesting different crops, fallow fields, or different growing stages\n\nThis looks like a rural agricultural area, possibly in Europe, where sustainable farming practices like contour plowing are used alongside renewable energy infrastructure (wind farms)."
        }
    ],
    "stop_reason": "end_turn",
    "stop_sequence": null,
    "usage": {
        "input_tokens": 858,
        "cache_creation_input_tokens": 0,
        "cache_read_input_tokens": 0,
        "cache_creation": {
            "ephemeral_5m_input_tokens": 0,
            "ephemeral_1h_input_tokens": 0
        },
        "output_tokens": 219,
        "service_tier": "standard"
    }
}
修改于 2025-11-29 15:52:05
上一页
开启思考
下一页
函数调用
Built with