bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 10쪽 중 4쪽
liability to the extent such liability cannot be excluded or limited under applicable law.
## Updates to These Terms
DGrid may update these Terms from time to time. If DGrid makes material changes, DGrid may provide notice by updating this page, the effective date, or through other reasonable means.
Your continued access to or use of AI Gateway after updated Terms become effective constitutes acceptance of the updated Terms, to the extent permitted by applicable law.
## Contact
If you have questions about these Terms or AI Gateway policy matters, please contact DGrid at [hi@dgrid.ai](mailto:hi@dgrid.ai).
# Create speech
Source: https://docs.dgrid.ai/api-reference/audio/create-speech
api-reference/openapi.json POST /v1/audio/speech
Convert text into natural speech with the OpenAI-compatible audio speech interface. Returns a binary audio stream — save the response body directly to a file.
# Create transcription
Source: https://docs.dgrid.ai/api-reference/audio/create-transcription
api-reference/openapi.json POST /v1/audio/transcriptions
Transcribe uploaded audio into text with the OpenAI-compatible Whisper-style interface. Supported formats: FLAC, MP3, MP4, MPEG, MPGA, M4A, OGG, WAV, and WebM.
# Create translation
Source: https://docs.dgrid.ai/api-reference/audio/create-translation
api-reference/openapi.json POST /v1/audio/translations
Translate uploaded audio into English with the OpenAI-compatible translation endpoint.
# Native Gemini Format
Source: https://docs.dgrid.ai/api-reference/audio/native-gemini-format
api-reference/openapi.json POST /v1/models/{model}:generateContent
Gemini-native generateContent interface for text chat, multimodal media recognition (images, audio, video), speech synthesis, and image generation with structured parts. Use `generationConfig` to request specific response modalities such as speech (`speechConfig`) or images (`imageConfig`).
This page uses the same `generateContent` operation as [Generate content (Gemini)](/api-reference/chat/generate-content), with the playground above pre-filled for plain text chat. The notes below describe the Gemini-native fields you can add to `generationConfig` to request audio understanding or generation with structured parts.
<Note>
Set `generationConfig.responseModalities` to `["AUDIO"]` to request audio output, and configure `generationConfig.speechConfig.voiceConfig.prebuiltVoiceConfig.voiceName` to choose a prebuilt voice for generated speech.
</Note>
### Gemini-native request fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------- | ------ | -------- | ------------------------------------------------ |
| `generationConfig.responseModalities` | array | Yes | Requested response modalities, e.g. `["AUDIO"]`. |
| `generationConfig.speechConfig` | object | No | Speech configuration object. |
| `generationConfig.speechConfig.voiceConfig` | object | No | Voice configuration wrapper. |
| `generationConfig.speechConfig.voiceConfig.prebuiltVoiceConfig` | object | No | Prebuilt voice settings. |
| `generationConfig.speechConfig.voiceConfig.prebuiltVoiceConfig.voiceName` | string | No | Prebuilt voice preset name, e.g. `Kore`. |
<Tip>
Use a text-to-speech-capable model such as `gemini-2.5-flash-preview-tts` in the `model` path parameter when requesting audio output.
</Tip>
### Example: requesting speech audio
```json theme={null}
{
"contents": [
{
"role": "user",
"parts": [
{ "text": "Say cheerfully: Have a wonderful day!" }
]
}
],
"generationConfig": {
"responseModalities": ["AUDIO"],
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "Kore"
}
}
}
}
}
```
### Response fields
The response follows the standard `generateContent` shape. When audio output is requested, the returned `parts` contain inline audio data instead of text:
<ResponseField name="candidates" type="array">
Candidate responses returned by the model.
<Expandable title="candidate properties">
<ResponseField name="content" type="object">
Generated content object.
<Expandable title="content properties">
<ResponseField name="role" type="string">
Role returned in the generated content block, typically `model`.
</ResponseField>
<ResponseField name="parts" type="array">
Returned parts. For audio output, each part contains an `inlineData` object with `mimeType` (e.g. `audio/L16;codec=pcm;rate=24000`) and base64-encoded `data`.
</ResponseField>
</Expandable>
</ResponseField>
<ResponseField name="finishReason" type="string">
Finish reason string, e.g. `STOP`.
</ResponseField>
<ResponseField name="safetyRatings" type="array">
Safety evaluation results.
</ResponseField>
</Expandable>
</ResponseField>
<ResponseField name="usageMetadata" type="object">
Token accounting, including `promptTokenCount`, `candidatesTokenCount`, and `totalTokenCount`.
</ResponseField>
<ResponseField name="promptFeedback" type="object">
Prompt blocking feedback when applicable.
</ResponseField>
### Example response
```json 200 theme={null}
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"inlineData": {
"mimeType": "audio/L16;codec=pcm;rate=24000",
"data": "<base64-encoded-audio-bytes>"
}
}
]
},
"finishReason": "STOP",
"safetyRatings": []
}
],
"usageMetadata": {
"promptTokenCount": 10,
"candidatesTokenCount": 0,
"totalTokenCount": 10
}
}
```
# Create chat completion
Source: https://docs.dgrid.ai/api-reference/chat/create-chat-completion
api-reference/openapi.json POST /v1/chat/completions
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.
# Create message (Claude)
Source: https://docs.dgrid.ai/api-reference/chat/create-message
api-reference/openapi.json POST /v1/messages
Claude Messages API for Anthropic-compatible payloads, tool use, and system prompts.
# Create response
Source: https://docs.dgrid.ai/api-reference/chat/create-response
api-reference/openapi.json POST /v1/responses
OpenAI Responses API for stateful flows, reasoning-specific options, and newer OpenAI tooling patterns.
# Gemini Media Recognition
Source: https://docs.dgrid.ai/api-reference/chat/gemini-media-recognition
api-reference/openapi.json POST /v1/models/{model}:generateContent
Gemini-native generateContent interface for text chat, multimodal media recognition (images, audio, video), speech synthesis, and image generation with structured parts. Use `generationConfig` to request specific response modalities such as speech (`speechConfig`) or images (`imageConfig`).
This page uses the same `generateContent` operation as [Generate content (Gemini)](/api-reference/chat/generate-content), with the playground above pre-filled for plain text chat. The notes below describe the Gemini-native multimodal fields you can add to `contents[].parts` to analyze images, audio, video, or mixed media in a single request.
<Note>
Each part can carry inline data (base64-encoded bytes plus a MIME type) alongside text instructions, letting the model reason across modalities in one call.
</Note>
### Gemini-native request fields
The generic `contents` and `generationConfig` fields shown in the playground accept the following nested shape for multimodal recognition:
| Field | Type | Required | Description |
| ---------------------------------------- | ------ | -------- | -------------------------------------------------------------------------- |
| `contents[].role` | string | No | Role of the turn, e.g. `user`. |
| `contents[].parts` | array | Yes | Ordered list of content parts (text and/or inline media). |
| `contents[].parts[].text` | string | No | Text instruction or question for the model. |
| `contents[].parts[].inlineData` | object | No | Inline media payload for image, audio, or video understanding. |
| `contents[].parts[].inlineData.mimeType` | string | No | MIME type of the inline data, e.g. `image/jpeg`, `audio/mp3`, `video/mp4`. |
| `contents[].parts[].inlineData.data` | string | No | Base64-encoded media bytes. |
<Tip>
You can mix multiple parts in a single turn — for example a `text` part with an instruction followed by one or more `inlineData` parts containing the media to analyze.
</Tip>
### Example: analyzing an image
```json theme={null}
{
"contents": [
{
"role": "user",
"parts": [
{ "text": "Describe what is happening in this image." },
{
"inlineData": {
"mimeType": "image/jpeg",
"data": "<base64-encoded-image-bytes>"
}
}
]
}
]
}
```
### Response fields
The response follows the standard `generateContent` shape. The fields most relevant to media recognition are:
<ResponseField name="candidates" type="array">
Candidate responses returned by the model.
<Expandable title="candidate properties">
<ResponseField name="content" type="object">
Generated content object.
<Expandable title="content properties">
<ResponseField name="role" type="string">
Role returned in the generated content block, typically `model`.
</ResponseField>
<ResponseField name="parts" type="array">
Returned content parts, typically text describing the analyzed media.
</ResponseField>
</Expandable>
</ResponseField>
<ResponseField name="finishReason" type="string">
Finish reason string, e.g. `STOP`.
</ResponseField>
<ResponseField name="safetyRatings" type="array">
Safety evaluation results.
</ResponseField>
</Expandable>
</ResponseField>
<ResponseField name="usageMetadata" type="object">
Token accounting metadata, including `promptTokenCount`, `candidatesTokenCount`, and `totalTokenCount`. Inline media (images, audio, video) consumes prompt tokens in addition to any text parts.
</ResponseField>
### Example response
```json 200 theme={null}
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{ "text": "The image shows a golden retriever sitting on a grassy lawn." }
]
},
"finishReason": "STOP",
"safetyRatings": []
}
],
"usageMetadata": {
"promptTokenCount": 264,
"candidatesTokenCount": 18,
"totalTokenCount": 282
}
}
```
# Generate content (Gemini)
Source: https://docs.dgrid.ai/api-reference/chat/generate-content
api-reference/openapi.json POST /v1/models/{model}:generateContent
Gemini-native generateContent interface for text chat, multimodal media recognition (images, audio, video), speech synthesis, and image generation with structured parts. Use `generationConfig` to request specific response modalities such as speech (`speechConfig`) or images (`imageConfig`).
# Create completion
Source: https://docs.dgrid.ai/api-reference/completions/create-completion
api-reference/openapi.json POST /v1/completions
Classic OpenAI-compatible text completion for single-prompt generation workloads that do not require a multi-message chat schema.
# Create embeddings
Source: https://docs.dgrid.ai/api-reference/embeddings/create-embedding
api-reference/openapi.json POST /v1/embeddings
OpenAI-compatible embeddings for retrieval, clustering, and semantic similarity workloads.
# Create embeddings (legacy engines)
Source: https://docs.dgrid.ai/api-reference/embeddings/create-engine-embedding
api-reference/openapi.json POST /v1/engines/{engine}/embeddings
Legacy engine-based embeddings path format for older SDK integrations.
# Create image
Source: https://docs.dgrid.ai/api-reference/images/create-image
api-reference/openapi.json POST /v1/images/generations
OpenAI-compatible image generation. Also accepts Qwen-compatible payloads (`wanx-v1` style models) using an `input.messages` wrapper instead of `prompt`.
# Edit image
Source: https://docs.dgrid.ai/api-reference/images/edit-image
api-reference/openapi.json POST /v1/images/edits
Edit an uploaded image with an optional mask using the OpenAI-compatible image editing endpoint. Also accepts Qwen-compatible JSON payloads with an `input.messages` wrapper.
# Gemini Native Format
Source: https://docs.dgrid.ai/api-reference/images/gemini-native-format
api-reference/openapi.json POST /v1/models/{model}:generateContent
Gemini-native generateContent interface for text chat, multimodal media recognition (images, audio, video), speech synthesis, and image generation with structured parts. Use `generationConfig` to request specific response modalities such as speech (`speechConfig`) or images (`imageConfig`).
This page uses the same `generateContent` operation as [Generate content (Gemini)](/api-reference/chat/generate-content), with the playground above pre-filled for plain text chat. The notes below describe the Gemini-native fields you can add to `generationConfig` to generate or edit images with provider-specific response controls.
<Note>
Set `generationConfig.responseModalities` to `["IMAGE"]` to request image output, and use `generationConfig.imageConfig` to control the aspect ratio and output size.
</Note>
### Gemini-native request fields
| Field | Type | Required | Description |
| ------------------------------------------ | ------ | -------- | ------------------------------------------------- |
| `generationConfig.responseModalities` | array | Yes | Requested modalities array, e.g. `["IMAGE"]`. |
| `generationConfig.imageConfig` | object | No | Image configuration object. |
| `generationConfig.imageConfig.aspectRatio` | string | No | Aspect ratio for the generated image, e.g. `1:1`. |
| `generationConfig.imageConfig.imageSize` | string | No | Output image size, e.g. `1024x1024`. |
<Tip>
Use an image-generation-capable model such as `gemini-2.0-flash-preview-image-generation` in the `model` path parameter.
</Tip>
### Example: generating an image
```json theme={null}
{
"contents": [
{
"role": "user",
"parts": [
{ "text": "A photorealistic image of a corgi wearing sunglasses on a beach." }
]
}
],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {
"aspectRatio": "1:1",
"imageSize": "1024x1024"
}
}
}
```
### Response fields
The response follows the standard `generateContent` shape. When image output is requested, the returned `parts` contain inline image data:
<ResponseField name="candidates" type="array">
Candidate responses returned by the model.
<Expandable title="candidate properties">
<ResponseField name="content" type="object">
Generated content object.
<Expandable title="content properties">
<ResponseField name="role" type="string">
Role returned in the generated content block, typically `model`.
</ResponseField>
<ResponseField name="parts" type="array">
Returned content parts. For image output, each part contains an `inlineData` object with `mimeType` (e.g. `image/png`) and base64-encoded `data`.
</ResponseField>
</Expandable>
</ResponseField>
<ResponseField name="finishReason" type="string">
Finish reason string, e.g. `STOP`.
</ResponseField>
<ResponseField name="safetyRatings" type="array">
Safety evaluation results.
</ResponseField>
</Expandable>
</ResponseField>
<ResponseField name="usageMetadata" type="object">
Token usage metadata, including `promptTokenCount`, `candidatesTokenCount`, and `totalTokenCount`.
</ResponseField>
### Example response
```json 200 theme={null}
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"inlineData": {
"mimeType": "image/png",
"data": "<base64-encoded-image-bytes>"
}
}
]
},
"finishReason": "STOP",
"safetyRatings": []
}
],
"usageMetadata": {
"promptTokenCount": 14,
"candidatesTokenCount": 0,
"totalTokenCount": 14
}
}
```
# OpenAI Chat Format
Source: https://docs.dgrid.ai/api-reference/images/openai-chat-format
api-reference/openapi.json POST /v1/chat/completions
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.
This page uses the same `chat/completions` operation as [Create chat completion](/api-reference/chat/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.
<Note>
Include an image-generation model in `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`.
</Note>
### 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. |
<Tip>
The `contents` field is a DGrid extension layered on top of the standard chat completions schema — it lets you pass Gemini-native `parts` (such as `inlineData`) alongside the OpenAI-style `messages` array when the target model supports it.
</Tip>
### Example: requesting an image
```json theme={null}
{
"model": "gemini-2.0-flash-preview-image-generation",
"stream": false,
"messages": [
{
"role": "user",
"content": "Generate an image of a futuristic city skyline at sunset."
}
]
}
```
### Response fields
The response follows the standard chat completions shape. The generated image is embedded directly in the assistant message content:
<ResponseField name="choices" type="array">
Returned choice entries.
<Expandable title="choice properties">
<ResponseField name="index" type="integer">
Choice index.
</ResponseField>
<ResponseField name="message" type="object">
Assistant message object.
<Expandable title="message properties">
<ResponseField name="role" type="string">
Message role, typically `assistant`.
</ResponseField>
<ResponseField name="content" type="string">
Message content. For image-output models, this is a markdown image reference embedding the generated image as a base64 data URI, e.g. ``.
</ResponseField>
</Expandable>
</ResponseField>
<ResponseField name="finish_reason" type="string">
Finish reason, e.g. `stop`.
</ResponseField>
</Expandable>
</ResponseField>
<ResponseField name="usage" type="object">
Token usage summary.
</ResponseField>
### Example response
```json 200 theme={null}
{
"id": "chatcmpl-abc123",
"model": "gemini-2.0-flash-preview-image-generation",
"object": "chat.completion",
"created": 1719859200,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": ""
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 0,
"total_tokens": 12
}
}
```
# Qwen Image Edits
Source: https://docs.dgrid.ai/api-reference/images/qwen-image-edits
api-reference/openapi.json POST /v1/images/edits
Edit an uploaded image with an optional mask using the OpenAI-compatible image editing endpoint. Also accepts Qwen-compatible JSON payloads with an `input.messages` wrapper.
This page uses the same `images/edits` operation as [Edit image](/api-reference/images/edit-image), with the playground above pre-filled for the generic OpenAI-style edit schema (`image`, `mask`, `prompt`, etc.). The notes below describe the Qwen-specific request shape for `wanx-v1` style models.
<Note>
Qwen image editing models accept an alternate JSON request shape that wraps your editing instructions and source image references inside `input.messages`, rather than upl프로젝트로 돌아가기