OpenAI Chat Format
OpenAI-compatible Chat Completions for standard multi-turn chat, structured output, and tool calling. Model names use the provider/model-name format, for example openai/gpt-4o. Image-capable models can also return generated images through this endpoint.
chat/completions operation as Create chat completion, with the playground above pre-filled for the generic chat schema. The notes below describe how to use this endpoint to request Gemini-backed image generation from an OpenAI-compatible client.
model (such as gemini-2.0-flash-preview-image-generation), set stream as needed, and supply your prompt through messages. Optionally include contents for additional Gemini-style multimodal context alongside messages.Provider-specific notes
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Image-generation model identifier, e.g. gemini-2.0-flash-preview-image-generation. |
messages[].content | string | Yes | Prompt text describing the desired image. |
contents | array | No | Optional Gemini-style content array for additional multimodal context, not part of the standard OpenAI chat schema. |
Example: requesting an image
Response fields
The response follows the standard chat completions shape. The generated image is embedded directly in the assistant message content:Example response
Authorizations
Your DGrid API key. All endpoints use Authorization: Bearer <DGRID_API_KEY>.
Body
Target model ID in provider/model-name format.
"openai/gpt-4o"
Conversation message list.
Sampling temperature.
Nucleus sampling value.
Number of choices to generate.
Enable SSE streaming.
Maximum token count.
Max completion-only tokens.
Presence penalty.
Frequency penalty.
Token bias configuration.
Stop sequence string or array.
Tool definitions.
Tool selection behavior. Defaults to auto.
Response schema or JSON mode config.
Deterministic seed.
End-user identifier.

