Welcome,
Quick Start
Get started with the DrafterPlus AI API in seconds
curl https://ai.drafterplus.nl/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-haiku-4-5",
"messages": [{"role": "user", "content": "Hello!"}]
}'
API Keys
Usage
Tokens
Activity
Today's Limit
Plan Details
Plans
Free
- 20 requests / day
- 3 image generations / day
- Haiku models
- 1 API key
Pro
- 100 requests / day
- 25 image generations / day
- Haiku + Sonnet models
- 5 API keys
Plus
- 500 requests / day
- 50 image generations / day
- All models (incl. Opus)
- 10 API keys
API Documentation
Everything you need to integrate DrafterPlus AI into your applications
Base URL
All API requests should be made to the following base URL:
https://ai.drafterplus.nl/api/v1
Authentication
All API requests require authentication via a Bearer token. Include your API key in the Authorization header with every request:
Authorization: Bearer YOUR_API_KEY
You can generate API keys from the API Keys tab in your dashboard.
Chat Completions
/chat/completionsGenerate AI chat responses. Send a list of messages and receive a model-generated reply.
Request Body Parameters
model requiredmessages requiredrole ("system", "user", "assistant") and content.max_tokens optionaltemperature optionalstream optionaltrue, responses are streamed as Server-Sent Events (SSE).Example Request
{
"model": "claude-haiku-4-5",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"max_tokens": 1024,
"temperature": 0.7
}
Example Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "claude-haiku-4-5",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 18,
"completion_tokens": 9,
"total_tokens": 27
}
}
Image Generation
/images/generationsGenerate images from text descriptions.
Request Body Parameters
prompt requiredn optionalsize optional"1024x1024", "512x512". Default: "1024x1024".Example Request
{
"prompt": "A futuristic city at sunset",
"n": 1,
"size": "1024x1024"
}
Available Models
Models available depend on your subscription plan.
Free Plan
| Model | Description |
|---|---|
claude-haiku-4-5 | Fast, cost-effective responses for everyday tasks |
Pro Plan
| Model | Description |
|---|---|
claude-haiku-4-5 | Fast, cost-effective responses for everyday tasks |
claude-sonnet-4-5 | Balanced performance and quality |
claude-sonnet-4-6 | Enhanced reasoning capabilities |
Plus Plan
| Model | Description |
|---|---|
claude-haiku-4-5 | Fast, cost-effective responses for everyday tasks |
claude-sonnet-4-5 | Balanced performance and quality |
claude-sonnet-4-6 | Enhanced reasoning capabilities |
claude-opus-4-5 | Most powerful for complex, multi-step tasks |
claude-opus-4-6 | Latest flagship model with top-tier reasoning |
Rate Limits
Each plan includes a daily quota for API requests and image generations. Usage resets at midnight UTC.
| Plan | Chat Requests / Day | Image Generations / Day | Max API Keys |
|---|---|---|---|
| Free | 20 | 3 | 1 |
| Pro | 100 | 25 | 5 |
| Plus | 500 | 50 | 10 |
When you exceed your daily limit, requests return a 429 Too Many Requests error.
Error Codes
The API uses standard HTTP status codes. Error responses include a JSON body with details.
| Code | Meaning | Description |
|---|---|---|
400 | Bad Request | Invalid request body or missing required parameters |
401 | Unauthorized | Missing or invalid API key |
403 | Forbidden | Your plan does not include access to the requested model |
429 | Rate Limited | You have exceeded your daily request quota |
500 | Server Error | An unexpected error occurred on our end |
503 | Service Unavailable | The service is temporarily unavailable — please retry |
Error Response Format
{
"error": {
"message": "You have exceeded your daily rate limit.",
"type": "rate_limit_error",
"code": 429
}
}
Code Examples
Get started quickly with these examples in your preferred language.
cURL
curl https://ai.drafterplus.nl/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-haiku-4-5",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Python
import requests
response = requests.post(
"https://ai.drafterplus.nl/api/v1/chat/completions",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"model": "claude-haiku-4-5",
"messages": [
{"role": "user", "content": "Hello!"}
]
}
)
data = response.json()
print(data["choices"][0]["message"]["content"])
JavaScript (Node.js / Browser)
const response = await fetch("https://ai.drafterplus.nl/api/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "claude-haiku-4-5",
messages: [
{ role: "user", content: "Hello!" }
]
})
});
const data = await response.json();
console.log(data.choices[0].message.content);
OAuth2 for Developers
Let users sign in with their DrafterPlus account and use AI through your app — without ever seeing their API keys.
How It Works
Quick Setup
Go to Applications → Create an app → Save your client_id and client_secret.
Step 1 — Redirect to Login
Send users to this URL:
https://ai.drafterplus.nl/oauth/authorize
?client_id=YOUR_CLIENT_ID
&redirect_uri=https://yourapp.com/callback
&response_type=code
&state=RANDOM_STRING
client_idredirect_uriresponse_typecodestateStep 2 — Get the Auth Code
After the user approves, they're redirected to your redirect_uri:
https://yourapp.com/callback?code=AUTH_CODE&state=RANDOM_STRING
Step 3 — Exchange Code for Token
const resp = await fetch('https://ai.drafterplus.nl/oauth/token', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
grant_type: 'authorization_code',
code: 'AUTH_CODE_FROM_CALLBACK',
client_id: 'YOUR_CLIENT_ID',
client_secret: 'YOUR_CLIENT_SECRET',
redirect_uri: 'https://yourapp.com/callback'
})
});
const { access_token } = await resp.json();
// access_token = "dpai_ct_..." — save this!
import requests
resp = requests.post('https://ai.drafterplus.nl/oauth/token', json={
'grant_type': 'authorization_code',
'code': 'AUTH_CODE_FROM_CALLBACK',
'client_id': 'YOUR_CLIENT_ID',
'client_secret': 'YOUR_CLIENT_SECRET',
'redirect_uri': 'https://yourapp.com/callback'
})
token = resp.json()['access_token'] # dpai_ct_...
Step 4 — Use the Token
The client token works just like an API key. Use it to make AI requests on behalf of the user:
// Send a chat message via the user's account
const ai = await fetch('https://ai.drafterplus.nl/api/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer dpai_ct_YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'claude-haiku-4-5',
messages: [{ role: 'user', content: 'Hello!' }]
})
});
const data = await ai.json();
console.log(data.choices[0].message.content);
const img = await fetch('https://ai.drafterplus.nl/api/v1/images/generate', {
method: 'POST',
headers: {
'Authorization': 'Bearer dpai_ct_YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt: 'A futuristic city at sunset',
size: '1024x1024'
})
});
const { url } = await img.json();
Available Models
claude-haiku-4-5claude-sonnet-4-5claude-opus-4-6Client tokens inherit the user's plan. If the user has Free, only Haiku is available.
Token Response Format
{
"access_token": "dpai_ct_a1b2c3d4...",
"token_type": "Bearer",
"scope": "ai:chat ai:images",
"app_name": "YourApp"
}
Error Handling
401403429Security
Complete Example — Express.js App
const express = require('express');
const crypto = require('crypto');
const app = express();
const CLIENT_ID = 'your_client_id';
const CLIENT_SECRET = 'your_client_secret';
const REDIRECT_URI = 'https://yourapp.com/callback';
// Step 1: User clicks "Login with DrafterPlus"
app.get('/login', (req, res) => {
const state = crypto.randomBytes(16).toString('hex');
req.session.oauthState = state;
res.redirect(
`https://ai.drafterplus.nl/oauth/authorize` +
`?client_id=${CLIENT_ID}` +
`&redirect_uri=${encodeURIComponent(REDIRECT_URI)}` +
`&response_type=code&state=${state}`
);
});
// Step 2: Handle the callback
app.get('/callback', async (req, res) => {
const { code, state } = req.query;
if (state !== req.session.oauthState) {
return res.status(403).send('Invalid state');
}
// Step 3: Exchange code for token
const resp = await fetch(
'https://ai.drafterplus.nl/oauth/token',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
grant_type: 'authorization_code',
code, client_id: CLIENT_ID,
client_secret: CLIENT_SECRET,
redirect_uri: REDIRECT_URI
})
}
);
const { access_token } = await resp.json();
// Save token — now you can make AI calls!
req.session.dpToken = access_token;
res.redirect('/dashboard');
});
// Step 4: Use the token for AI
app.post('/ask-ai', async (req, res) => {
const ai = await fetch(
'https://ai.drafterplus.nl/api/v1/chat/completions',
{
method: 'POST',
headers: {
'Authorization': `Bearer ${req.session.dpToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'claude-haiku-4-5',
messages: [{ role: 'user', content: req.body.question }]
})
}
);
const data = await ai.json();
res.json({ answer: data.choices[0].message.content });
});
app.listen(3000);
System Status
Services
Support
Submit a Ticket
Have an issue or question? Send us a message and we'll get back to you.
Your Tickets
Connected Applications
Applications you have authorized to access your DrafterPlus AI account.
Settings
Email Notifications
Choose which events trigger an email notification.