Skip to content

How do I make my first AISwapLab API request without accidentally generating a video?

Start on your server with authenticated GET /api/v1/models, then optionally GET /api/v1/usage. These read-only routes check the account connection and current model information without creating media. Keep the API key out of browser code and logs. A successful catalog response establishes connectivity for that request, not credits, model readiness for every operation or permission to submit an unapproved generation.

START WITH THE APIAISwapLab team · Editorial methodUpdated 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Prepare the server-side connection; Inspect the response before proceeding; Check usage and define the next boundary.
Workflow diagram: Prepare the server-side connection → Inspect the response before proceeding → Check usage and define the next boundary. Read the article for evidence and limits.

Use a read-only diagnostic before testing any paid creation route

The API base is https://aiswaplab.com/api/v1. Account sign-in cookies and developer API keys serve different surfaces; opening the website while signed in is not an API credential test. Create a key with the intended model scope, expiry and monthly allowance through the account workflow. Key creation itself does not grant credits. Keep production secrets on trusted server infrastructure, and use local fixtures for creation and recovery tests until a real paid request is deliberately authorized.

What to do next

  1. 01

    Prepare the server-side connection

    Store the key in your server's secret configuration and set Authorization: Bearer with that value when calling the documented API origin. Do not put it in a NEXT_PUBLIC variable, mobile bundle, screenshot or pasted support message. Check that the request method is GET and the path ends in /models, not a generation endpoint.

  2. 02

    Inspect the response before proceeding

    Record HTTP status and a redacted diagnostic. On success, find the exact model alias and read available and reason. A 401 concerns authentication; a 403 can involve scope or allowance. Fix the stated issue rather than changing the operation to a paid generation to see whether that works.

  3. 03

    Check usage and define the next boundary

    Use GET /usage when you need account balance, key allowance and recent-job context. Then prepare a separate quote step for the exact intended input. Do not let a quickstart automatically continue from connection success to POST /videos, /images/generations or /chat/completions.

A concrete example

Illustrative first run: a developer's server receives a valid model list, but the selected image model reports unavailable. They mark the connection test passed and generation readiness blocked, storing no credential in the report. Their application can still be tested with a catalog fixture for that state. They do not create a video as a substitute probe or claim that obtaining a key supplied free credits.

First connection checklist

RoutePurposeDoes it generate?
GET /modelsCurrent aliases and availabilityNo
GET /usageBalance, allowance and recent jobsNo
POST /quotesSeparate exact-input estimateNo generation
Creation POSTExplicitly approved paid workMay reserve/consume credits

Before you call it ready

  • Only documented read-only routes were used in the connection check.
  • No API secret appears in client code or diagnostics.
  • Connectivity, model availability and credit readiness are separate conclusions.

When to stop or choose another method

Stop before paid creation if the alias, permission, availability or budget remains unresolved. A successful GET is the end of this diagnostic, not blanket approval for the next POST.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation