Nukerhugo AI is live: model infrastructure, hosted in the Netherlands →
Nukerhugo / AI / Docs

API documentation.

A straightforward HTTP API for interacting with a range of language models. List available models, request a full completion, or stream a response token-by-token — all through a single base URL.

Getting started

Overview

A straightforward HTTP API for interacting with a range of language models. List available models, request a full completion, or stream a response token-by-token — all through a single base URL.

Base URL

All API requests are made to https://nukerhugo.nl/ai/api/index.php. The desired action is selected using the endpoint query parameter.

Endpoints

The API exposes three actions from a single base URL, selected via the endpoint query parameter.

What you wantRequest
List modelsGET?endpoint=models
Full chat replyPOST?endpoint=chat
Streaming replyPOST?endpoint=chat/stream

Authentication

This API does not require authentication for the open-access model set. No API keys, tokens, or headers beyond Content-Type: application/json are needed to make requests. Larger, key-gated models (such as deepseek-v4-flash) are available through the Enterprise API. Free keys for testing are available on the Enterprise page; see Key-gated models below for how to use one.

Note on usage

Because the endpoint is open, please use it responsibly. Abusive request patterns may result in rate limiting or access restrictions. No fixed rate limit is published for the open-access models; see the Terms.

Privacy

Prompts and model outputs are not stored or logged. Only minimal request metadata (timestamps and request counts) is kept. See the Data Retention Policy.

Request

GETList models

Returns the list of open-access models currently available for use in chat requests.

RequestContent-TypeAuth required
?endpoint=modelsapplication/jsonNo
Bash / curl
curl "https://nukerhugo.nl/ai/api/index.php?endpoint=models"

Response:

JSON — Response
{
  "default": "gemma-1b",
  "available": {
    "gemma-1b":        { "context_window": 2048 },
    "qwen-1.5b":       { "context_window": 4096 },
    "qwen-3b":         { "context_window": 4096 },
    "nukegpt-3b":      { "context_window": 4096 },
    "nukegpt-360m":    { "context_window": 2048 },
    "smollm2-360m":    { "context_window": 2048 },
    "bonsai-27b":      { "context_window": 8192 },
    "bonsai-27b-slow": { "context_window": 8192 }
  }
}
Response shape

default is the model used if a request omits model. available is an object keyed by model ID, not an array — look up a model's context_window via its key.

Model list changes over time

Available models are added and removed periodically. Call this endpoint at runtime rather than hardcoding model IDs, and treat the list above as a snapshot rather than a guarantee. You can also check live status for a real-time read. Key-gated models are not included in this list; see Key-gated models.

POSTChat

For a full, non-streamed reply, use the chat endpoint with a model and a messages array.

FieldTypeDescription
modelstringIdentifier of the model to use. See List Models for valid values. Optional — omitting it uses the default model returned by List Models.
messages requiredarrayArray of {role, content} objects. role is system, user, or assistant. An optional system message may lead the array to set behavior/persona; user/assistant turns after it should alternate, ending on user.
JSON — Request body
{
  "model": "qwen-1.5b",
  "messages": [
    { "role": "user", "content": "Hello!" }
  ]
}

Response:

JSON — Response
{
  "model": "qwen-1.5b",
  "message": {
    "role": "assistant",
    "content": "Hello! How can I assist you today?"
  },
  "usage": {
    "prompt_tokens": 67,
    "completion_tokens": 12,
    "total_tokens": 79
  }
}
Bash / curl
curl -X POST "https://nukerhugo.nl/ai/api/index.php?endpoint=chat" \
  -H "Content-Type: application/json" \
  -d '{"model":"qwen-1.5b","messages":[{"role":"user","content":"Hello!"}]}'

System prompts

Prepend a system message to the messages array to set behavior, tone, or persona for the conversation. Supported on all available models, including gemma-1b.

JSON — Request body with system prompt
{
  "model": "gemma-1b",
  "messages": [
    { "role": "system", "content": "You are a pirate. Speak only in pirate." },
    { "role": "user", "content": "Hello!" }
  ]
}

POSTChat (streaming)

Same request shape as chat, but the response streams as newline-delimited data: lines, each holding a small JSON chunk. Use this to render tokens as they arrive.

JavaScript — fetch + ReadableStream
const response = await fetch('https://nukerhugo.nl/ai/api/index.php?endpoint=chat/stream', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    model: 'qwen-1.5b',
    messages: [{ role: 'user', content: 'Tell me a short story.' }]
  })
});

const reader = response.body.getReader();
const decoder = new TextDecoder();

while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  const chunk = decoder.decode(value);
  for (const line of chunk.split('\n')) {
    if (!line.startsWith('data:')) continue;
    const data = JSON.parse(line.slice(5));
    if (data.token) document.body.append(data.token);
    if (data.done) console.log('stream finished');
  }
}
Chunk shape

Each line decodes to {"token": "..."} for generated text, and a final {"done": true} once the stream ends.

Multi-turn conversations

Each request is independent. To continue a conversation, include the full prior history in the messages array, alternating user / assistant turns, and ending on a user message.

JSON — Multi-turn request body
{
  "model": "qwen-1.5b",
  "messages": [
    { "role": "user", "content": "What is 2+2?" },
    { "role": "assistant", "content": "4" },
    { "role": "user", "content": "Multiply that by 3." }
  ]
}
Context window limit

The combined token count of all messages in the array, plus the reply, must stay within the chosen model's context window (see List Models — this varies by model: 2048, 4096 or 8192 tokens for the open-access models). Requests exceeding this limit currently return a generic 500 Internal Server Error rather than a descriptive error, so prune your history proactively rather than relying on the API to reject oversized requests gracefully.

Key-gated models (Enterprise API)

Larger models run behind a separate, OpenAI-compatible endpoint and need an API key. Get a free key (no credit card needed) on the Enterprise page, or from your terminal:

Bash / curl — Sign up
curl -X POST "https://nukerhugo.nl/ai/enterprise/api/?endpoint=signup" \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com"}'

Your key is shown once and only a hash is stored, so save it. There is one free key per email address.

Bash / curl — Chat request
curl https://nukerhugo.nl/ai/enterprise/api/v1/chat/completions \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"Hello!"}]}'

With any OpenAI library, set the base URL to https://nukerhugo.nl/ai/enterprise/api/v1 and use your key as the API key. To check your remaining budget:

Bash / curl — Usage
curl "https://nukerhugo.nl/ai/enterprise/api/?endpoint=usage" \
  -H "X-API-Key: YOUR_KEY"

The usage endpoint returns your plan, daily budget, tokens used and tokens remaining.

ModelContext windowAccess
deepseek-v4-flash1M tokensIncluded with every key. It thinks before it answers, and that thinking counts towards your daily token budget.
qwen3.8-flash-next256K tokensAvailability varies. Contact sales to use it.
LimitDetails
Daily token budgetFree: 100,000 tokens per key per day. Partner plans are agreed per contract. Prompt, generated and thinking tokens all count.
ResetEvery day at 00:00 UTC. When a budget is used up, requests get HTTP 429 until then.
Per requestNo fixed limit on answer length. A single request is cut off at whatever is left of your daily budget.
Request timeRequests without streaming time out after 5 minutes. For long answers, use streaming.
Free keys come without a service guarantee

Models run on shared hardware, so responses can be slower at busy times. Key-gated models are not returned by ?endpoint=models.

Response

Success response

On success, the API returns HTTP 200 OK with a JSON object containing the model name and the assistant's reply.

FieldTypeDescription
modelstringThe model that generated the reply.
message.rolestringAlways assistant.
message.contentstringThe model-generated text response to the prompt.
usage.prompt_tokensintegerNumber of tokens in the input (all messages combined).
usage.completion_tokensintegerNumber of tokens in the generated reply.
usage.total_tokensintegerSum of prompt and completion tokens.
JSON — Success response
{
  "model": "qwen-1.5b",
  "message": {
    "role": "assistant",
    "content": "Paris is the capital of France."
  },
  "usage": {
    "prompt_tokens": 45,
    "completion_tokens": 12,
    "total_tokens": 57
  }
}

Error response

When the request cannot be fulfilled, the API returns a non-200 HTTP status code along with a JSON object describing the failure. The shape of detail varies by error type: a plain string for method, model, and endpoint errors, or an array of validation-error objects for malformed/incomplete request bodies.

FieldTypeDescription
detailstring | arrayA human-readable description of what went wrong, or (for 422 responses) a list of field-level validation errors.
JSON — Error response (string detail)
{
  "detail": "Model 'nonexistent-model' not found."
}
JSON — Error response (validation detail, 422)
{
  "detail": [
    {
      "type": "missing",
      "loc": ["body", "messages"],
      "msg": "Field required"
    }
  ]
}

HTTP status codes

The API uses standard HTTP status codes to indicate the outcome of each request. Always check the HTTP status code before parsing the response body.

CodeStatusMeaning
200OKThe request was successful.
400Bad RequestThe endpoint query parameter is missing or did not match a known action.
404Not FoundThe requested model value does not match an available model. See List Models for valid values.
405Method Not AllowedThe request used the wrong HTTP method for the chosen endpoint (e.g. GET on chat).
422Unprocessable EntityThe request body was missing a required field or contained invalid JSON. The response detail field lists the specific validation errors.
429Too Many RequestsEnterprise API only: the key's daily token budget is used up. It resets at 00:00 UTC. See Key-gated models.
500Internal Server ErrorInference failed — most commonly because the combined message history exceeded the model's context window (see Multi-turn conversations). Retrying after a short delay may resolve transient failures, but oversized requests will continue to fail until trimmed.
Examples

Code examples

Ready-to-use implementations in four languages, using the full (non-streaming) chat endpoint.

Bash / curl
curl -X POST "https://nukerhugo.nl/ai/api/index.php?endpoint=chat" \
  -H "Content-Type: application/json" \
  -d '{"model":"qwen-1.5b","messages":[{"role":"user","content":"Hello, who are you?"}]}'

Try it

Send a live request to the API directly from this page and inspect the response in real time.

Live production request

This console sends a real request to the production model server with each click. Please use it sparingly rather than repeated submissions.

POST?endpoint=chat

Results appear below the request.

Reference

Known limitations

Worker pool processing

Requests are handled by a pool of workers, so multiple requests are typically processed in parallel rather than one at a time. During traffic spikes, requests beyond available worker capacity are queued and may see increased latency. There is currently no mechanism to check queue depth or expected wait time — check live status for current reachability.

Per-model context window

Each model has a fixed maximum combined token length across prompt (or full message history) and response — check context_window from List Models rather than assuming a single number for all models. There is no dynamic context expansion. Token counts are approximate and vary by content.

Availability

The service is provided as-is and as available. Models may be changed or removed at any time, and rate limits may be applied with or without notice. See the Terms.

These constraints are fixed at the infrastructure level and are not configurable via request parameters.