Run in Apifox
Googleの最新Gemini-1.5-Proバージョン 以下のモデルをサポートしています gemini-exp-1114 gemini-exp-1121 gemini-exp-1206 gemini-2.0-flash-exp gemini-2.0-flash-thinking-exp-1219 gemini-2.0-flash-thinking-exp-01-21 gemini-2.0-flash gemini-2.0-flash-lite-preview-02-05 gemini-2.0-pro-exp-02-05 gemini-2.5-pro-exp-03-25 gemini-2.5-flash-preview-04-17 gemini-2.5-pro-preview-05-06 gemini-2.5-pro-preview-05-06-thinking(思考プロセスを示す) gemini-2.5-flash-preview-05-20 gemini-2.5-flash-preview-05-20-nothink(思考を強制的に閉じる) gemini-2.5-pro-preview-06-05 gemini-2.5-pro-preview-06-05-thinking(思考プロセスを示す) gemini-2.5-pro gemini-2.5-flash gemini-2.5-flash-lite-preview-06-17 注意:APIの形式を改造し、OpenAIのAPI形式と互換性を持たせました Request Body Params application/json
{
"model" : "gemini-1.5-pro" ,
"messages" : [ { "role" : "user" , "content" : "你是谁" } ]
}
Request Code Samples
curl --location --request POST 'https://api.302.ai/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer sk-mfYQzy0XTFfz4P16vRE4gFrKK1Nly4TozsMqbbb9PSiJUvFO' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gemini-1.5-pro",
"messages": [{"role": "user", "content": "你是谁"}]
}'
Responses application/json Generate Code
{
"id" : "chatcmpl-123" ,
"object" : "chat.completion" ,
"created" : 1677652288 ,
"choices" : [
{
"index" : 0 ,
"message" : {
"role" : "assistant" ,
"content" : "\n\nHello there, how may I assist you today?"
} ,
"finish_reason" : "stop"
}
] ,
"usage" : {
"prompt_tokens" : 9 ,
"completion_tokens" : 12 ,
"total_tokens" : 21
}
}
Modified at 2025-08-26 10:08:48