Generate Text

POST /api/v1/generate-text

Generate text from a prompt using AI language models. Useful for creating scene descriptions, prompts, scripts, and other text content.

Request Body

Name Type Required Default Description
prompt string Yes — Text prompt to generate from
model string No gemini-3-flash-preview Model key
Values: "gemini-3-flash-preview", "gemini-3-pro-preview", "gemini-2.5-pro", "gpt-5.2", "gpt-5.1", "gpt-5", "gpt-5-mini", "gpt-5-nano", "o3", "o3-deep-research", "grok-4-1-fast-non-reasoning", "grok-4-1-fast-reasoning"
Example Request
curl -X POST https://api.dalnulla.com/api/v1/generate-text \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "prompt": "Write a short description of a cyberpunk city at night",
    "model": "gemini-3-flash-preview"
  }'

Responses

Success

200 OK
{
  "text": "Neon signs flicker through the perpetual smog, casting prismatic reflections across rain-slicked streets. Towering megastructures pierce the clouds, their surfaces alive with holographic advertisements..."
}

Errors

400 Bad Request
{
  "error": "Prompt is required"
}
401 Unauthorized
{
  "error": "Unauthorized: Invalid or expired token"
}
402 Payment Required
{
  "error": "Insufficient credits. Required: 8, Remaining: 2"
}
403 Forbidden
{
  "error": "This model requires a Pro subscription",
  "code": "MODEL_REQUIRES_SUBSCRIPTION",
  "model": "gpt-5",
  "requiredTier": "Pro"
}
500 Internal Server Error
{
  "error": "Internal Server Error"
}