Skip to main content

OpenAI chat format (Chat Completions + Gemini image)

Standard OpenAI Chat Completions, with chat-style prompts driving Gemini image generation.

Basics

  • Endpoint: POST /v1/chat/completions
  • Auth: Bearer Token
  • Content-Type: application/json

Request body


Response

200 OK

Request example

Response example


Tips

  1. Extracting images: content often embeds ![image](data:image/jpeg;base64,...)—parse the data URI for display.
  2. extra_body: Standard OpenAI SDK extension slot for vendor options without breaking the protocol.
  3. Mock: For local tests, http://127.0.0.1:4523/mock/7707339.