Armox
    Armox Academy 📚
    API-ReferenzEinführung in die API-ReferenzModelle-Endpunkt

    Models-Endpunkt

    Die Models-API ermöglicht Ihnen:

    • verfügbare Modell-IDs und Einstellungen zu entdecken
    • eine Modellausführung pro Anfrage durchzuführen

    Basispfad:

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

    GET /api/v1/models

    Gibt alle verfügbaren Modelle und ihre Konfigurations-Metadaten zurück.

    Anfrage

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

    Antwort

    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

    Führt eine Modellgenerierung aus.

    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"
    }

    Felder:

    • model (erforderlich): Modell-ID aus GET /api/v1/models
    • input (optionales Objekt): modellspezifische Eingaben und Einstellungen
    • webhook_url (optional): Callback-URL für Abschluss-Events

    Synchrones vs. asynchrones Verhalten

    POST /models/run kann entweder zurückgeben:

    • 200 für synchrone Fertigstellung (typischerweise Bild-/Text-/Tool-Ausgaben)
    • 202 für asynchrone Verarbeitung (Video-/Audio-/3D-Ausgaben)

    Beispiel: Bildmodell-Ausführung (synchron)

    Anfrage

    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"
        }
      }'

    Typische 200-Antwort

    {
      "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"
    }
    

    Beispiel: Videomodell-Ausführung (asynchron)

    Anfrage

    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
        }
      }'
    

    Typische 202-Antwort

    {
      "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"
    }
    

    Anschließend pollen:

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

    JavaScript-Beispiel

    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-Beispiel

    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())
    

    Fehler, die Sie behandeln sollten

    • 400 ungültiger Payload oder ungültiges Modell
    • 401 fehlender/ungültiger API-Schlüssel
    • 402 unzureichende Credits
    • 403 Zugriff durch Abonnement eingeschränkt
    • 429 Rate Limit überschritten

    Vollständige Details finden Sie unter: Fehler & Rate Limits

    Verwandte Seiten

    Bereit, deinen kreativen Workflow zu transformieren?

    Keine Kreditkarte erforderlich2000 kostenlose Credits