Passer au contenu principal
POST
/
v1beta
/
models
/
{model}
:streamGenerateContent
curl -X POST "https://api.lemondata.cc/v1beta/models/gemini-2.5-pro:streamGenerateContent?key=sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "parts": [{"text": "Tell me a story"}]
      }
    ]
  }'
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {"text": "Once upon a time"}
        ]
      }
    }
  ]
}
Version streaming du point de terminaison Gemini generateContent. Retourne des Server-Sent Events.

Paramètres de chemin

model
string
requis
Nom du modèle (par ex., gemini-2.5-pro, gemini-2.5-flash).

Paramètres de requête

key
string
Clé API (alternative à l’authentification par en-tête).

Corps de la requête

Identique à Générer du contenu.

Réponse

Retourne un flux d’objets JSON, chacun contenant une réponse partielle.
curl -X POST "https://api.lemondata.cc/v1beta/models/gemini-2.5-pro:streamGenerateContent?key=sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "parts": [{"text": "Tell me a story"}]
      }
    ]
  }'
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {"text": "Once upon a time"}
        ]
      }
    }
  ]
}