Quickstart
DGrid AI Gateway unifies the interfaces of hundreds of AI models. You don’t need to handle compatibility adaptations for different models in your code—with a single API endpoint and a standardized API request format, you can freely switch and access all the hundreds of models provided by DGrid.The DGrid official SDK is currently under active development—stay tuned for its release. Below are the available temporary request methods to interact with DGrid AI Gateway.
Prerequisites
Before getting started, you need to:- Obtain a valid
DGRID_API_KEY(Guide). - Ensure your development environment has network access to
https://api.dgrid.ai/v1. - For SDK usage, install the corresponding OpenAI SDK package in your project.
Direct API Request via cURL
You can send a direct HTTP POST request to the DGrid AI Gateway endpoint using cURL.Using the OpenAI SDK (DGrid Compatible)
DGrid AI Gateway is fully compatible with the OpenAI SDK specification. You only need to modify thebaseURL (and fill in the DGRID_API_KEY) to quickly migrate or integrate.
Prerequisite: Install the OpenAI SDK
First, install the OpenAI SDK in your project:TypeScript Implementation
Python Implementation
Additional Notes
- Optional Headers: The
HTTP-RefererandX-Titleheaders are optional, but filling them in helps DGrid better identify your application and provide more optimized service support. - Model Naming Format: The model parameter uses the format
[provider]/[model-name](e.g.,openai/gpt-4o), which is consistent across all DGrid-supported models for easy switching. - SDK Development Update: The official DGrid SDK is under development and will provide more native features and optimized performance—please pay attention to the official DGrid documentation updates for release information.

