API Reference

Flexura API Documentation

One API key. Internet search + media generation. Works with every major AI agent.

Quick Navigation

AuthenticationSkill InstallSearch InternetGenerate ImageGenerate VideoGenerate AudioCheck Job StatusModel Catalog

Authentication

All API requests require an API key. Include it as a Bearer token in the Authorization header:

Authorization: Bearer fx_live_xxxxxxxxxxxx

Create your API key at /dashboard. Store it in the MEDIA_GATEWAY_API_KEY environment variable.

⚠️ Your API key is shown only once at creation. Store it securely — it cannot be recovered.

Skill Install

One Command

Install the Flexura skill into any AI agent with a single command. The script auto-detects your agent environment:

curl -fsSL http://localhost:3000/api/install/flexura-skill | bash

Or target a specific agent:

# OpenAI Codex
curl -fsSL http://localhost:3000/api/install/flexura-skill | bash --target codex

# Cursor
curl -fsSL http://localhost:3000/api/install/flexura-skill | bash --target cursor

# Windsurf
curl -fsSL http://localhost:3000/api/install/flexura-skill | bash --target windsurf

# Claude Desktop
curl -fsSL http://localhost:3000/api/install/flexura-skill | bash --target claude

# Aider
curl -fsSL http://localhost:3000/api/install/flexura-skill | bash --target aider

# Cline
curl -fsSL http://localhost:3000/api/install/flexura-skill | bash --target cline
POST

/api/generate/image

Async

Submit an image generation job. Returns a job_id immediately — poll /api/jobs/{job_id} for the result.

Request Body

prompt string required

Description of the image to generate.

model string default: "nvidia-flux"

Model to use. Fetch /api/agent/models for available models.

options.width number default: 1024

Image width in pixels.

options.height number default: 1024

Image height in pixels.

options.steps number default: 4

Number of diffusion steps.

options.seed number default: 0

Random seed for reproducibility.

Examples

curl -X POST http://localhost:3000/api/generate/image \
  -H "Authorization: Bearer $MEDIA_GATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a futuristic city at night, neon lights, cinematic",
    "model": "nvidia-flux",
    "options": { "width": 1024, "height": 1024 }
  }'

Response (202 Accepted)

{ "job_id": "abc-123", "status": "queued" }
POST

/api/generate/video

Async

Submit a video generation job. Same async pattern as image generation — returns a job_id, poll for completion.

curl -X POST http://localhost:3000/api/generate/video \
  -H "Authorization: Bearer $MEDIA_GATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "a cat playing with a ball of yarn" }'
POST

/api/generate/audio

Async

Submit an audio generation job. Same async pattern — returns a job_id, poll for completion.

curl -X POST http://localhost:3000/api/generate/audio \
  -H "Authorization: Bearer $MEDIA_GATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "calm ambient background music" }'
GET

/api/jobs/{job_id}

Check the status of a generation job. Poll every 5 seconds until status is completed or failed.

Possible Statuses

queuedprocessingcompletedfailed

Response (completed)

{
  "job_id": "abc-123",
  "status": "completed",
  "type": "image",
  "asset_url": "http://localhost:3000/api/assets/abc-123.png",
  "prompt": "a futuristic city at night",
  "created_at": "2026-04-01T00:00:00.000Z",
  "updated_at": "2026-04-01T00:00:12.000Z"
}

Response (failed)

{
  "job_id": "abc-123",
  "status": "failed",
  "error": "Model provider returned an error",
  "type": "image"
}
GET

/api/agent/models

Returns the live model catalog. Agents should always fetch this before choosing a model — never hardcode model IDs.

curl http://localhost:3000/api/agent/models

Response

{
  "platform": "Flexura",
  "capabilities": {
    "search": {
      "endpoint_url": "http://localhost:3000/api/search",
      "method": "POST",
      "description": "Search the internet with AI-optimized results"
    }
  },
  "models": [
    {
      "id": "nvidia-flux",
      "type": "image",
      "endpoint_url": "http://localhost:3000/api/generate/image",
      "description": "Fast image generation for photorealistic prompts",
      "status": "active",
      "input": {
        "prompt": "string",
        "options": { "width": "number", "height": "number" }
      }
    }
  ]
}

Quick Reference

ActionMethodPathType
Search internetPOST/api/searchInstant
Generate imagePOST/api/generate/imageAsync
Generate videoPOST/api/generate/videoAsync
Generate audioPOST/api/generate/audioAsync
Check job statusGET/api/jobs/{job_id}Instant
Model catalogGET/api/agent/modelsInstant

Ready to start?

Create your free account and get an API key in 30 seconds.

Create free account →