AIXHUBDocs

Quick start

Sign in, create an API key, confirm an available model, and send your first request through AIXHUB.

This guide takes you from the AIXHUB console to a verifiable API response. You only need the console and a local terminal. No server deployment is required.

Prerequisites

  • An account that can sign in to the AIXHUB console.
  • Bash or Zsh with curl, or Windows PowerShell 5.1 or later.
  • A secure place for your API key, outside source code and Git.

Steps

  1. Open the AIXHUB console and sign in. If you do not have an account yet, follow Account registration and sign-in.

  2. Open API keys and create a key dedicated to local testing.

  3. Open Available channels and copy a model ID that is currently available. Models and protocols can change with channel availability, so use the information shown on this page at the time of setup.

  4. Set the key and model in your terminal. Replace the model value with the complete ID copied in the previous step.

    Bash or Zsh

    export AIXHUB_API_KEY="sk-your-key"
    export AIXHUB_MODEL="panel-model-id"

    Windows PowerShell

    $env:AIXHUB_API_KEY = "sk-your-key"
    $env:AIXHUB_MODEL = "panel-model-id"
  5. Send a minimal request to the Anthropic Messages compatible endpoint.

    POSThttps://api.aixhub.org/v1/messages

    Bash or Zsh

    curl https://api.aixhub.org/v1/messages \
      --header "content-type: application/json" \
      --header "x-api-key: $AIXHUB_API_KEY" \
      --header "anthropic-version: 2023-06-01" \
      --data "{\"model\":\"$AIXHUB_MODEL\",\"max_tokens\":64,\"messages\":[{\"role\":\"user\",\"content\":\"Reply with OK only.\"}]}"

    Windows PowerShell

    $headers = @{
      "x-api-key" = $env:AIXHUB_API_KEY
      "anthropic-version" = "2023-06-01"
    }
    $body = @{
      model = $env:AIXHUB_MODEL
      max_tokens = 64
      messages = @(
        @{ role = "user"; content = "Reply with OK only." }
      )
    } | ConvertTo-Json -Depth 4
    $request = @{
      Uri = "https://api.aixhub.org/v1/messages"
      Method = "Post"
      Headers = $headers
      ContentType = "application/json"
      Body = $body
    }
    
    Invoke-RestMethod @request

Verification

You receive a JSON response containing model-generated text. A matching call also appears in the console usage records after processing.

This minimal example is non-streaming. Treat it as complete only when HTTP 200 includes the expected JSON text. Preserve the original error code for any 4xx or 5xx response.

Troubleshooting

  • 401: API_KEY_REQUIRED or INVALID_API_KEY means the key is missing, incorrect, or not loaded in the current terminal.
  • 403: Insufficient balance returns INSUFFICIENT_BALANCE. Retry only after the Dashboard balance has updated.
  • A model error is not always 404: Invalid input can be 400, while no routable account can be 503. Verify the complete path and the model ID in Available channels.
  • 429: Reduce rate and concurrency, then honor Retry-After. Do not classify insufficient balance as 429.
  • response.failed: A streaming client must parse the terminal event instead of checking only the initial HTTP 200.
  • A variable is sent literally: Run the complete example for your shell. Bash and PowerShell variable syntax cannot be mixed.

See Troubleshooting for a complete status-code workflow.

Next step

Continue with the client setup guides, Claude Code, Codex CLI, OpenAI SDK, or Anthropic SDK, depending on how you work.

On this page