DadGPT OpenAI-Compatible API Reference
This document describes how to use the DadGPT API with agentic coding tools like Cline, Roo Code, Continue, Aider, and other OpenAI-compatible clients.
Quick Start
Base URL
https://www.dadgpt.live/v1
1. Create a DadGPT API Key
- Log in to DadGPT.
- Go to Settings -> API Keys.
- Click Create New API Key.
- Copy the key immediately. It is shown only once.
DadGPT API keys start with:
sk-dad_2. Use the Key in Requests
All API requests require the key in the Authorization header:
Authorization: Bearer sk-dad_your_api_key_here3. Configure Your Client
Use these values in any OpenAI-compatible app:
| Setting | Value |
|---|---|
| Provider | OpenAI-compatible |
| Base URL | https://www.dadgpt.live/v1 |
| API Key | sk-dad_your_api_key_here |
| Model | dadgpt-default or dadgpt-beast |
Endpoints
POST /v1/chat/completions
Generate AI chat completions. Supports both streaming and non-streaming responses.
Request Body
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | No | dadgpt-default | Model to use. Options: dadgpt-default, dadgpt-beast |
messages | array | Yes | - | Array of message objects with role and content |
stream | boolean | No | false | Whether to stream the response |
temperature | number | No | 0.9 | Sampling temperature (0-2) |
max_tokens | number | No | 4096 | Maximum tokens to generate |
top_p | number | No | 0.95 | Nucleus sampling parameter |
frequency_penalty | number | No | 0.5 | Frequency penalty (-2 to 2) |
presence_penalty | number | No | 0.5 | Presence penalty (-2 to 2) |
Message Object
{
"role": "user" | "assistant" | "system",
"content": "Your message here"
}Example Request
curl -X POST https://www.dadgpt.live/v1/chat/completions \
-H "Authorization: Bearer sk-dad_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "dadgpt-default",
"messages": [
{"role": "system", "content": "You are a helpful coding assistant"},
{"role": "user", "content": "Write a Python function to calculate fibonacci numbers"}
],
"stream": true
}'Response (Non-Streaming)
{
"id": "chatcmpl-abc123xyz",
"object": "chat.completion",
"created": 1703123456,
"model": "dadgpt-default",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Here's a Python function..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 150,
"total_tokens": 175
}
}Response (Streaming)
Streaming responses use Server-Sent Events (SSE):
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1703123456,"model":"dadgpt-default","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null}]}
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1703123456,"model":"dadgpt-default","choices":[{"index":0,"delta":{"content":"Here's"},"finish_reason":null}]}
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1703123456,"model":"dadgpt-default","choices":[{"index":0,"delta":{"content":" a"},"finish_reason":null}]}
...
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1703123456,"model":"dadgpt-default","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: [DONE]
GET /v1/models
List available models.
Example Request
curl https://www.dadgpt.live/v1/models \
-H "Authorization: Bearer sk-dad_your_api_key"Response
{
"object": "list",
"data": [
{
"id": "dadgpt-default",
"object": "model",
"created": 1703123456,
"owned_by": "dadgpt"
},
{
"id": "dadgpt-beast",
"object": "model",
"created": 1703123456,
"owned_by": "dadgpt"
}
]
}Models
| Model | Description | Token Cost |
|---|---|---|
dadgpt-default | Balanced model for general use | 1 token/request |
dadgpt-beast | Extended context, more detailed responses | 3 tokens/request |
Rate Limits
- Default: 60 requests per minute per API key
- Rate limit headers are included in responses:
X-RateLimit-Limit: Maximum requests per minuteX-RateLimit-Remaining: Remaining requests in current windowX-RateLimit-Reset: Unix timestamp when the limit resets
Error Responses
All errors follow the OpenAI error format:
{
"error": {
"message": "Error description",
"type": "error_type",
"param": null,
"code": "error_code"
}
}Error Codes
| Status | Code | Description |
|---|---|---|
| 401 | missing_api_key | Missing Authorization: Bearer sk-dad_... header |
| 401 | invalid_api_key | Invalid DadGPT API key |
| 401 | api_key_expired | API key has expired |
| 402 | insufficient_quota | Insufficient tokens in account |
| 403 | account_suspended | Account has been suspended |
| 429 | rate_limit_exceeded | Too many requests |
| 400 | invalid_request | Malformed request |
| 400 | model_not_found | Invalid model specified |
| 500 | internal_error | Server error |
Troubleshooting 401 Errors
If you get a 401 error, check the following:
- The
Authorizationheader is present and formatted asBearer sk-dad_your_api_key. - The API key is copied correctly with no extra spaces.
- The API key has not been deleted or expired in Settings -> API Keys.
If the key still fails, create a new key in Settings -> API Keys and try again.
Tool Configurations
Cline (VS Code)
In your VS Code settings (settings.json):
{
"cline.apiProvider": "openai-compatible",
"cline.apiBaseUrl": "https://www.dadgpt.live/v1",
"cline.apiKey": "sk-dad_your_api_key_here",
"cline.model": "dadgpt-default"
}Roo Code
{
"roo.provider": "openai-compatible",
"roo.baseUrl": "https://www.dadgpt.live/v1",
"roo.apiKey": "sk-dad_your_api_key_here",
"roo.model": "dadgpt-default"
}Continue
In your Continue configuration (~/.continue/config.json):
{
"models": [
{
"title": "DadGPT",
"provider": "openai",
"model": "dadgpt-default",
"apiBase": "https://www.dadgpt.live/v1",
"apiKey": "sk-dad_your_api_key_here"
}
]
}Aider
export OPENAI_API_BASE=https://www.dadgpt.live/v1
export OPENAI_API_KEY=sk-dad_your_api_key_here
aider --model dadgpt-defaultOpenAI Python SDK
from openai import OpenAI
client = OpenAI(
api_key="sk-dad_your_api_key_here",
base_url="https://www.dadgpt.live/v1"
)
response = client.chat.completions.create(
model="dadgpt-default",
messages=[
{"role": "user", "content": "Hello!"}
],
stream=True
)
for chunk in response:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")curl
curl -X POST https://www.dadgpt.live/v1/chat/completions \
-H "Authorization: Bearer sk-dad_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "dadgpt-default",
"messages": [{"role": "user", "content": "Hello!"}]
}'Best Practices
- Keep your API key secure - Never commit API keys to version control
- Use environment variables - Store keys in environment variables, not code
- Handle rate limits - Implement exponential backoff for 429 responses
- Use streaming for long responses - Streaming provides better UX for code generation
- Monitor your usage - Check the Settings page for API usage statistics
Support
- Telegram: @Automax_0
- Issues: Create an issue on GitHub