Armox
    Armox Academy 📚
    API ReferenceAPI Reference IntroductionModels Endpoint

    Models Endpoint

    The Models API lets you:

    • discover available model IDs and settings
    • run one model execution per request

    Base path:

    • https://armox.ai/api/v1/models

    GET /api/v1/models

    Returns all available models and their configuration metadata.

    Request

    curl -X GET "https://armox.ai/api/v1/models" \
      -H "Authorization: Bearer sk_live_your_key_here"
    

    Response

    Prompt Template
    {
      "object": "list",
      "data": [
        {
          "id": "google/nano-banana",
          "name": "Nano Banana",
          "modality": "image",
          "cost": 70,
          "inputTypes": ["text", "image"],
          "promptRequired": true,
          "outputType": "image",
          "description": "Google image generation and editing model",
          "settings": [
            {
              "key": "aspect_ratio",
              "label": "Aspect Ratio",
              "inputType": "select",
              "defaultValue": "1:1"
            }
          ]
        }
      ]
    }

    POST /api/v1/models/run

    Runs one model generation.

    Request Body

    Prompt Template
    {
      "model": "google/nano-banana",
      "input": {
        "prompt": "string",
        "image_input": ["https://example.com/image.jpg"]
      },
      "webhook_url": "https://your-app.com/webhooks/armox"
    }

    Fields:

    • model (required): model ID from GET /api/v1/models
    • input (optional object): model-specific inputs and settings
    • webhook_url (optional): callback URL for completion events

    Synchronous vs Asynchronous Behavior

    POST /models/run can return either:

    • 200 for sync completion (typically image/text/tool outputs)
    • 202 for async processing (video/audio/3d outputs)

    Example: Image Model Run (Sync)

    Request

    Prompt Template
    curl -X POST "https://armox.ai/api/v1/models/run" \
      -H "Authorization: Bearer sk_live_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "google/nano-banana",
        "input": {
          "prompt": "Turn this into a cinematic night street photo with neon signs and reflections.",
          "image_input": ["https://example.com/reference-image.jpg"],
          "aspect_ratio": "match_input_image",
          "output_format": "png"
        }
      }'

    Typical 200 Response

    {
      "id": "a1b2c3d4-e5f6-7890-ab12-34567890abcd",
      "object": "job",
      "status": "completed",
      "model": "google/nano-banana",
      "output": {
        "outputImage": "https://storage.example.com/public/api-outputs/..."
      },
      "error": null,
      "credits_charged": 70,
      "created_at": "2026-03-26T12:00:00.000Z",
      "completed_at": "2026-03-26T12:00:03.000Z"
    }
    

    Example: Video Model Run (Async)

    Request

    curl -X POST "https://armox.ai/api/v1/models/run" \
      -H "Authorization: Bearer sk_live_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "xai/grok-video-image-to-video",
        "input": {
          "prompt": "Animate this image with smooth camera movement and subtle environmental motion.",
          "image_input": "https://example.com/reference-image.jpg",
          "duration": 4
        }
      }'
    

    Typical 202 Response

    {
      "id": "f1e2d3c4-b5a6-7890-cd12-34567890efab",
      "object": "job",
      "status": "processing",
      "model": "xai/grok-video-image-to-video",
      "credits_charged": 202,
      "created_at": "2026-03-26T12:10:00.000Z"
    }
    

    Then poll:

    curl -X GET "https://armox.ai/api/v1/jobs/f1e2d3c4-b5a6-7890-cd12-34567890efab" \
      -H "Authorization: Bearer sk_live_your_key_here"
    

    JavaScript Example

    const response = await fetch("https://armox.ai/api/v1/models/run", {
      method: "POST",
      headers: {
        Authorization: "Bearer sk_live_your_key_here",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        model: "google/nano-banana",
        input: {
          prompt: "High-end product photo on clean white background",
        },
      }),
    });
    
    const job = await response.json();
    console.log(job);
    

    Python Example

    import requests
    
    response = requests.post(
        "https://armox.ai/api/v1/models/run",
        headers={
            "Authorization": "Bearer sk_live_your_key_here",
            "Content-Type": "application/json",
        },
        json={
            "model": "google/nano-banana",
            "input": {"prompt": "High-end product photo on clean white background"},
        },
    )
    
    print(response.status_code)
    print(response.json())
    

    Errors You Should Handle

    • 400 invalid payload or invalid model
    • 401 missing/invalid API key
    • 402 insufficient credits
    • 403 access restricted by subscription
    • 429 rate limit exceeded

    See full details: Errors & Rate Limits