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. 模型-对话

创建对话补全(OpenAI 兼容)

POST
/v1/chat/completions
以 OpenAI Chat Completions 兼容格式发起对话。参数清单以 dto.GeneralOpenAIRequest 为准。
Gemini nano 系列图片模型(gemini-3.1-flash-image-preview 等)经此端点调用,图片在对话响应中返回。
示例:向 claude-sonnet-4-6 发送一条用户消息并开启流式输出。

请求参数

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/chat/completions' \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
    "audio": [
        0
    ],
    "chat_template_kwargs": [
        0
    ],
    "dimensions": 0,
    "enable_search": [
        0
    ],
    "enable_thinking": [
        0
    ],
    "encoding_format": [
        0
    ],
    "extra_body": [
        0
    ],
    "frequency_penalty": 0,
    "function_call": [
        0
    ],
    "functions": [
        0
    ],
    "input": null,
    "instruction": "string",
    "logit_bias": [
        0
    ],
    "logprobs": true,
    "max_completion_tokens": 0,
    "max_tokens": 0,
    "messages": [
        {
            "content": null,
            "name": "string",
            "prefix": true,
            "reasoning": "string",
            "reasoning_content": "string",
            "role": "string",
            "tool_call_id": "string",
            "tool_calls": [
                0
            ]
        }
    ],
    "metadata": [
        0
    ],
    "modalities": [
        0
    ],
    "model": "string",
    "n": 0,
    "parallel_tool_calls": true,
    "prediction": [
        0
    ],
    "prefix": null,
    "presence_penalty": 0,
    "prompt": null,
    "prompt_cache_key": "string",
    "prompt_cache_retention": [
        0
    ],
    "reasoning": [
        0
    ],
    "reasoning_effort": "string",
    "reasoning_split": [
        0
    ],
    "response_format": {
        "json_schema": [
            0
        ],
        "type": "string"
    },
    "return_images": true,
    "return_related_questions": true,
    "safety_identifier": [
        0
    ],
    "search_domain_filter": [
        0
    ],
    "search_mode": [
        0
    ],
    "search_parameters": [
        0
    ],
    "search_recency_filter": [
        0
    ],
    "seed": 0,
    "service_tier": [
        0
    ],
    "size": "string",
    "stop": null,
    "store": [
        0
    ],
    "stream": true,
    "stream_options": {
        "include_obfuscation": true,
        "include_usage": true
    },
    "suffix": null,
    "temperature": 0,
    "think": [
        0
    ],
    "thinking": [
        0
    ],
    "tool_choice": null,
    "tools": [
        {
            "custom": [
                0
            ],
            "function": {
                "arguments": "string",
                "description": "string",
                "name": "string",
                "parameters": null
            },
            "id": "string",
            "type": "string"
        }
    ],
    "top_k": 0,
    "top_logprobs": 0,
    "top_p": 0,
    "usage": [
        0
    ],
    "user": [
        0
    ],
    "verbosity": [
        0
    ],
    "vl_high_resolution_images": [
        0
    ],
    "web_search": [
        0
    ],
    "web_search_options": {
        "search_context_size": "string",
        "user_location": [
            0
        ]
    }
}'
响应示例响应示例
200 - 示例 1
{
    "choices": [
        {
            "finish_reason": "string",
            "index": 0,
            "message": {
                "content": null,
                "name": "string",
                "prefix": true,
                "reasoning": "string",
                "reasoning_content": "string",
                "role": "string",
                "tool_call_id": "string",
                "tool_calls": [
                    0
                ]
            }
        }
    ],
    "created": null,
    "error": null,
    "id": "string",
    "model": "string",
    "object": "string",
    "usage": {
        "claude_cache_creation_1_h_tokens": 0,
        "claude_cache_creation_5_m_tokens": 0,
        "completion_tokens": 0,
        "completion_tokens_details": {
            "audio_tokens": 0,
            "image_tokens": 0,
            "reasoning_tokens": 0,
            "text_tokens": 0
        },
        "cost": null,
        "input_tokens": 0,
        "input_tokens_details": {
            "audio_tokens": 0,
            "cached_creation_tokens": 0,
            "cached_tokens": 0,
            "image_tokens": 0,
            "text_tokens": 0
        },
        "output_tokens": 0,
        "prompt_cache_hit_tokens": 0,
        "prompt_tokens": 0,
        "prompt_tokens_details": {
            "audio_tokens": 0,
            "cached_creation_tokens": 0,
            "cached_tokens": 0,
            "image_tokens": 0,
            "text_tokens": 0
        },
        "total_tokens": 0,
        "usage_semantic": "string",
        "usage_source": "string"
    }
}
上一页
语音翻译为英文文本
下一页
创建消息(Claude Messages 兼容)
Built with