Skip to content

Authentication

All API requests require authentication via an API key passed as a Bearer token.

sh
curl https://api.mindforge.ai/characters \
  -H "Authorization: Bearer YOUR_API_KEY"

API keys

API keys use the sk-mf- prefix and are created in the dashboard. Each key is scoped to a single project.

TIP

Mindforge API keys are project-scoped — a key for Project A won't work for Project B. This prevents accidental data mixing between projects.

Base URL

All endpoints are served from:

https://api.mindforge.ai

OpenAI-compatible endpoints use the /v1 prefix:

https://api.mindforge.ai/v1/chat/completions
https://api.mindforge.ai/v1/models

Error responses

All errors follow a consistent format:

json
{
  "code": 404,
  "message": "Character character_abc123 not found"
}

OpenAI-compatible endpoints return errors in OpenAI's format:

json
{
  "error": {
    "message": "Model 'nonexistent' not found.",
    "type": "invalid_request_error",
    "code": "model_not_found"
  }
}

Status codes

CodeMeaning
200Success
202Accepted (async processing started)
400Bad request — check your parameters
401Unauthorized — invalid or missing API key
404Resource not found
500Server error