1. 模型-对话
AiApi114
  • 模型-视频
    • 可灵 图生视频
      POST
    • 可灵 图生视频任务查询
      GET
    • 可灵 文生视频
      POST
    • 可灵 文生视频任务查询
      GET
    • 生成视频
      POST
    • 查询视频任务
      GET
  • 模型-音乐(Suno)
    • 批量查询 Suno 任务
      POST
    • 查询单个 Suno 任务
      GET
    • 提交 Suno 音乐任务
      POST
  • 模型-音频
    • 文本转语音(TTS)
      POST
    • 语音转文本(转写)
      POST
    • 语音翻译为英文文本
      POST
  • 模型-对话
    • 创建对话补全(OpenAI 兼容)
      POST
    • 创建消息(Claude Messages 兼容)
      POST
  • 模型-向量
    • 创建向量嵌入
      POST
  • 模型-图片
    • 编辑图片(图生图)
      POST
    • 生成图片(文生图)
      POST
    • Gemini 图片生成(文生图/图生图)
      POST
  • 模型-重排
    • 文档重排
      POST
  1. 模型-对话

创建消息(Claude Messages 兼容)

POST
/v1/messages
以 Claude Messages 兼容格式发起对话。请求体字段以本项目对 /v1/messages 的实际解析为准。

请求参数

Authorization
API Key
在 header 添加参数
Authorization
示例:
Authorization: ********************
or
Header 参数

Body 参数application/json必填

示例

返回响应

🟢200
application/json
消息结果
Bodyapplication/json

🟠400
🟠401
🔴500
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location 'https://aiapi114.com/v1/messages' \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
    "cache_control": [
        0
    ],
    "container": [
        0
    ],
    "context_management": [
        0
    ],
    "inference_geo": "string",
    "max_tokens": 0,
    "max_tokens_to_sample": 0,
    "mcp_servers": [
        0
    ],
    "messages": [
        {
            "content": null,
            "role": "string"
        }
    ],
    "metadata": [
        0
    ],
    "model": "string",
    "output_config": [
        0
    ],
    "output_format": [
        0
    ],
    "prompt": "string",
    "service_tier": "string",
    "speed": [
        0
    ],
    "stop_sequences": [
        "string"
    ],
    "stream": true,
    "system": null,
    "temperature": 0,
    "thinking": {
        "budget_tokens": 0,
        "display": "string",
        "type": "string"
    },
    "tool_choice": null,
    "tools": null,
    "top_k": 0,
    "top_p": 0
}'
响应示例响应示例
200 - 示例 1
{
    "completion": "string",
    "content": [
        {
            "cache_control": [
                0
            ],
            "content": null,
            "delta": "string",
            "id": "string",
            "input": null,
            "model": "string",
            "name": "string",
            "partial_json": "string",
            "role": "string",
            "signature": "string",
            "source": {
                "data": null,
                "media_type": "string",
                "type": "string",
                "url": "string"
            },
            "stop_reason": "string",
            "text": "string",
            "thinking": "string",
            "tool_use_id": "string",
            "type": "string",
            "usage": {
                "cache_creation": {
                    "ephemeral_1h_input_tokens": 0,
                    "ephemeral_5m_input_tokens": 0
                },
                "cache_creation_input_tokens": 0,
                "cache_read_input_tokens": 0,
                "claude_cache_creation_1_h_tokens": 0,
                "claude_cache_creation_5_m_tokens": 0,
                "input_tokens": 0,
                "output_tokens": 0,
                "server_tool_use": {
                    "web_search_requests": 0
                }
            }
        }
    ],
    "content_block": {
        "cache_control": [
            0
        ],
        "content": null,
        "delta": "string",
        "id": "string",
        "input": null,
        "model": "string",
        "name": "string",
        "partial_json": "string",
        "role": "string",
        "signature": "string",
        "source": {
            "data": null,
            "media_type": "string",
            "type": "string",
            "url": "string"
        },
        "stop_reason": "string",
        "text": "string",
        "thinking": "string",
        "tool_use_id": "string",
        "type": "string",
        "usage": {
            "cache_creation": {
                "ephemeral_1h_input_tokens": 0,
                "ephemeral_5m_input_tokens": 0
            },
            "cache_creation_input_tokens": 0,
            "cache_read_input_tokens": 0,
            "claude_cache_creation_1_h_tokens": 0,
            "claude_cache_creation_5_m_tokens": 0,
            "input_tokens": 0,
            "output_tokens": 0,
            "server_tool_use": {
                "web_search_requests": 0
            }
        }
    },
    "delta": {
        "cache_control": [
            0
        ],
        "content": null,
        "delta": "string",
        "id": "string",
        "input": null,
        "model": "string",
        "name": "string",
        "partial_json": "string",
        "role": "string",
        "signature": "string",
        "source": {
            "data": null,
            "media_type": "string",
            "type": "string",
            "url": "string"
        },
        "stop_reason": "string",
        "text": "string",
        "thinking": "string",
        "tool_use_id": "string",
        "type": "string",
        "usage": {
            "cache_creation": {
                "ephemeral_1h_input_tokens": 0,
                "ephemeral_5m_input_tokens": 0
            },
            "cache_creation_input_tokens": 0,
            "cache_read_input_tokens": 0,
            "claude_cache_creation_1_h_tokens": 0,
            "claude_cache_creation_5_m_tokens": 0,
            "input_tokens": 0,
            "output_tokens": 0,
            "server_tool_use": {
                "web_search_requests": 0
            }
        }
    },
    "error": null,
    "id": "string",
    "index": 0,
    "message": {
        "cache_control": [
            0
        ],
        "content": null,
        "delta": "string",
        "id": "string",
        "input": null,
        "model": "string",
        "name": "string",
        "partial_json": "string",
        "role": "string",
        "signature": "string",
        "source": {
            "data": null,
            "media_type": "string",
            "type": "string",
            "url": "string"
        },
        "stop_reason": "string",
        "text": "string",
        "thinking": "string",
        "tool_use_id": "string",
        "type": "string",
        "usage": {
            "cache_creation": {
                "ephemeral_1h_input_tokens": 0,
                "ephemeral_5m_input_tokens": 0
            },
            "cache_creation_input_tokens": 0,
            "cache_read_input_tokens": 0,
            "claude_cache_creation_1_h_tokens": 0,
            "claude_cache_creation_5_m_tokens": 0,
            "input_tokens": 0,
            "output_tokens": 0,
            "server_tool_use": {
                "web_search_requests": 0
            }
        }
    },
    "model": "string",
    "role": "string",
    "stop_reason": "string",
    "type": "string",
    "usage": {
        "cache_creation": {
            "ephemeral_1h_input_tokens": 0,
            "ephemeral_5m_input_tokens": 0
        },
        "cache_creation_input_tokens": 0,
        "cache_read_input_tokens": 0,
        "claude_cache_creation_1_h_tokens": 0,
        "claude_cache_creation_5_m_tokens": 0,
        "input_tokens": 0,
        "output_tokens": 0,
        "server_tool_use": {
            "web_search_requests": 0
        }
    }
}
上一页
创建对话补全(OpenAI 兼容)
下一页
创建向量嵌入
Built with