Welcome,

Chat Messages
0
Images Generated
0
API Calls
0
Tokens Used
0

Quick Start

Get started with the DrafterPlus AI API in seconds

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!"}]
  }'

API Keys

Usage

Chat
0
Image Gen
0
Image Edit
0
API Calls
0

Tokens

0 total
Input
0
Output
0
Total
0

Activity

Chat Images
Loading chart data...

Today's Limit

/ 20 requests
Resets in --:--:--

Plan Details

Current Plan Free
Daily Request Limit 20 requests
Image Generation Limit 3 / day
Available Models Haiku
Max API Keys 1

Plans

Free

€0/forever
  • 20 requests / day
  • 3 image generations / day
  • Haiku models
  • 1 API key

Plus

€24.99/week
  • 500 requests / day
  • 50 image generations / day
  • All models (incl. Opus)
  • 10 API keys
Have a discount code?
Loading...

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:

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:

Header
Authorization: Bearer YOUR_API_KEY

You can generate API keys from the API Keys tab in your dashboard.

Chat Completions

POST /chat/completions

Generate AI chat responses. Send a list of messages and receive a model-generated reply.

Request Body Parameters

model required
The model to use. See Available Models below.
messages required
Array of message objects with role ("system", "user", "assistant") and content.
max_tokens optional
Maximum number of tokens to generate. Default: 1024.
temperature optional
Sampling temperature (0–1). Lower = more deterministic. Default: 0.7.
stream optional
If true, responses are streamed as Server-Sent Events (SSE).

Example Request

JSON
{
  "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

JSON
{
  "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

POST /images/generations

Generate images from text descriptions.

Request Body Parameters

prompt required
A text description of the desired image.
n optional
Number of images to generate. Default: 1.
size optional
Image dimensions. Options: "1024x1024", "512x512". Default: "1024x1024".

Example Request

JSON
{
  "prompt": "A futuristic city at sunset",
  "n": 1,
  "size": "1024x1024"
}

Available Models

Models available depend on your subscription plan.

Free Plan

ModelDescription
claude-haiku-4-5Fast, cost-effective responses for everyday tasks

Pro Plan

ModelDescription
claude-haiku-4-5Fast, cost-effective responses for everyday tasks
claude-sonnet-4-5Balanced performance and quality
claude-sonnet-4-6Enhanced reasoning capabilities

Plus Plan

ModelDescription
claude-haiku-4-5Fast, cost-effective responses for everyday tasks
claude-sonnet-4-5Balanced performance and quality
claude-sonnet-4-6Enhanced reasoning capabilities
claude-opus-4-5Most powerful for complex, multi-step tasks
claude-opus-4-6Latest 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.

PlanChat Requests / DayImage Generations / DayMax API Keys
Free2031
Pro100255
Plus5005010

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.

CodeMeaningDescription
400Bad RequestInvalid request body or missing required parameters
401UnauthorizedMissing or invalid API key
403ForbiddenYour plan does not include access to the requested model
429Rate LimitedYou have exceeded your daily request quota
500Server ErrorAn unexpected error occurred on our end
503Service UnavailableThe service is temporarily unavailable — please retry

Error Response Format

JSON
{
  "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

bash
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

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)

javascript
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

1. User clicks "Login with DrafterPlus" in your app
You redirect them to our authorization page
2. User approves your app
They see what permissions you're requesting and click "Toestaan"
3. You get a client token
Exchange the auth code for a token — use it to call AI on behalf of the user

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:

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_id
Your app's client ID
redirect_uri
Must exactly match what you registered
response_type
Always code
state
Random string for CSRF protection — verify it on callback

Step 2 — Get the Auth Code

After the user approves, they're redirected to your redirect_uri:

Callback
https://yourapp.com/callback?code=AUTH_CODE&state=RANDOM_STRING

Step 3 — Exchange Code for Token

Node.js
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!
Python
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:

Chat Request
// 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);
Image Generation
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-5
Fast, free tier — available to all plans
claude-sonnet-4-5
Balanced — requires Pro plan or higher
claude-opus-4-6
Most capable — requires Plus plan

Client tokens inherit the user's plan. If the user has Free, only Haiku is available.

Token Response Format

JSON
{
  "access_token": "dpai_ct_a1b2c3d4...",
  "token_type": "Bearer",
  "scope": "ai:chat ai:images",
  "app_name": "YourApp"
}

Error Handling

401
Invalid or expired token — user needs to re-authorize
403
Model not available on user's plan
429
Rate limited — wait and retry

Security

✓ Client tokens never expose user API keys
✓ Auth codes expire after 5 min (single-use)
✓ Users can revoke access anytime via Connections
✓ Client secrets shown only once at creation
✓ Redirect URIs must exactly match
✓ Max 3 apps per account

Complete Example — Express.js App

server.js
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

Checking...
Overall System Health --%
API Status
Uptime
--
Response Time
--
Memory
--

Services

API Server
Checking...
--
Mail Server
Checking...
--
Authentication
Checking...
--
Database
Checking...
--
Loading history...

Support

Submit a Ticket

Have an issue or question? Send us a message and we'll get back to you.

Your Tickets

Loading tickets...

Connected Applications

Applications you have authorized to access your DrafterPlus AI account.

Settings

Email Notifications

Choose which events trigger an email notification.

Account

Danger Zone

Sign Out
Sign out of your account on this device.
Delete Account
Permanently delete your account. Applications deleted, connections revoked. 5-day email cooldown.