访问地址:国内 https://4sapi.org、https://4stoken.com;海外https://4sapi.top、https://4sapi.com、https://us.4sapi.com;纯 API 专线https://4sapi.ai;北美低延迟https://4sapi.net。详见《国内外直连域名》。
gemini-3.8-flashgemini-3.8-flash、gemini-4-argon、gemini-3-flash-preview、gemini-3.7-flash、gemini-3.1-pro-preview-customtools、gemini-3.6-flash、gemini-3.1-flash-lite、gemini-3.1-flash-lite-preview 等gs://开头的 GCS 地址仅在 Vertex 类分组(如 Verter-gemini、Gemini-官方)可用;AI Studio 类分组传gs://会返回 400。不确定时先用https://公开链接。
curl --location 'https://4sapi.org/v1beta/models/gemini-3.8-flash:generateContent' \
--header 'Authorization: sk-' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"parts": [
{
"fileData": {
"fileUri": "gs://cloud-samples-data/generative-ai/image/scones.jpg",
"mimeType": "image/jpeg"
}
},
{
"text": "What is in this image? One short phrase."
}
]
}
]
}'{
"error": {
"message": "Referencing Google Cloud Storage files directly is not supported. Register them using ***.RegisterFile first. ",
"type": "upstream_error",
"param": "",
"code": 400
}
}