# Streaming not working with OpenAI contract

**URL:** <https://discuss.ai.google.dev/t/streaming-not-working-with-openai-contract/59916>\
**Category:** Gemini API\
**Tags:** api\
**Created:** [January 10, 2025, 5:28am UTC](https://discuss.ai.google.dev/t/streaming-not-working-with-openai-contract/59916 "2025-01-10T05:28:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Utkarsh\_Srivastava](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/utkarsh_srivastava/32/37270_2.png) [@Utkarsh\_Srivastava](https://discuss.ai.google.dev/u/Utkarsh_Srivastava)\
**Post date:** [January 10, 2025, 5:28am UTC](https://discuss.ai.google.dev/t/streaming-not-working-with-openai-contract/59916/1 "2025-01-10T05:28:02Z")

</div>

The streaming request support with OpenAI API contract mentioned [here](https://ai.google.dev/gemini-api/docs/openai#streaming) does not work.

**Request:**

```auto
curl "https://generativelanguage.googleapis.com/v1beta/openai/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer GEMINI_API_KEY" \
-d '{
    "model": "gemini-1.5-flash",
    "messages": [
        {"role": "user", "content": "Explain to me how AI works"}
    ],
    "stream": true
  }'

```

**Response**

```auto
[{
  "error": {
    "code": 400,
    "message": "Invalid resource field value in the request.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "RESOURCE_PROJECT_INVALID",
        "domain": "googleapis.com",
        "metadata": {
          "method": "google.cloud.aiplatform.internal.PredictionService.StreamGenerateContent",
          "service": "aiplatform.googleapis.com"
        }
      }
    ]
  }
}]

```

---

<div class="post-metadata">

**Author:** ![Pannaga\_J](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/pannaga_j/32/31911_2.png) [@Pannaga\_J](https://discuss.ai.google.dev/u/Pannaga_J)\
**Post date:** [May 21, 2025, 11:16am UTC](https://discuss.ai.google.dev/t/streaming-not-working-with-openai-contract/59916/3 "2025-05-21T11:16:03Z")

</div>

Hi @Utkarsh_Srivastava . Apologies for the late response.  
Could you please try to use the latest model 2.5 flash and let us know if the issue still persist? Thank you!
