Skip to content

Gemini's openai-compatible API doesn't return toplevel id #338

@yoohaemin

Description

@yoohaemin

I tried Gemini's "openai-compatible" endpoint, and turns out they don't return id.

POST https://generativelanguage.googleapis.com/v1beta/openai/chat/completions

Example response

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "OK. I can book a flight from London to Tokyo for Jane Doe, age 34. Shall I proceed?",
        "role": "assistant"
      }
    }
  ],
  "created": 1747469284,
  "model": "models/gemini-2.5-flash-preview-04-17",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 24,
    "prompt_tokens": 138,
    "total_tokens": 448
  }
}

https://github.com/softwaremill/sttp-openai/blob/master/core/src/main/scala/sttp/openai/requests/completions/chat/ChatRequestResponseData.scala#L162

I wonder if the maintainers are open to make this field optional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions