简体中文
  • English
  • 简体中文
  1. Gemini
简体中文
  • English
  • 简体中文
  • OpenAI官方库使用教程
  • 前言(必读)
  • 获取 Base URL 和 API Key
  • OpenAI
    • Chat模型
      POST
    • Chat (o1-o4系列模型)
      POST
    • dall-e-3
      POST
    • gpt-image-1
      POST
    • Image edit图片编辑
      POST
    • Analyze image分子图片
      POST
    • Analyze PDF分析PDF
      POST
    • o3-pro-responses
      POST
  • Gemini
    • gemini
      POST
  1. Gemini

gemini

Developing
POST
{{base_url}}/v1/chat/completions
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST '{{base_url}}/v1/chat/completions' \
--header 'Authorization: sk-shdahd' \
--header 'Content-Type: application/json' \
--data-raw '{
  "model": "gemini-1.5-flash",
  "temperature": 0.5,
  "messages": [
    {
      "role": "user",
      "content": "hello"
    }
  ],
  "stream": false
}'
Response Response Example
{
    "id": "chatcmpl-9vyopQa0CKV5AO3JJzYtyaYeK73lk",
    "object": "chat.completion",
    "created": 1723605511,
    "model": "gemini-1.5-flash",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "Hello! How can I assist you today?",
                "refusal": null
            },
            "logprobs": null,
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 8,
        "completion_tokens": 9,
        "total_tokens": 17
    },
    "system_fingerprint": "fp_48196bc67a"
}

Request

Header Params

Body Params text/plain
Examples

Responses

🟢200成功
application/json
Body

Modified at 2025-06-04 09:19:31
Previous
o3-pro-responses
Built with