Skip to content

Quick Start ​

Use this guide to connect to LAYSO AI Gateway and make your first model request in about 3 minutes.

Prerequisites ​

  1. Sign in to the LAYSO AI console and create an API key
  2. Prepare Python 3.8+ or Node.js 18+

One gateway, familiar protocols

LAYSO AI supports OpenAI, Anthropic, and Gemini-compatible requests, so you can use a familiar SDK or HTTP client.

Choose an integration ​

Send API requests to https://api.layso.ai. Use the website at https://layso.ai to sign in, manage API keys, and view usage. For the OpenAI SDK, set the Base URL to https://api.layso.ai/v1.

OpenAI-compatible API — the most widely supported integration.

Terminal
curl https://api.layso.ai/v1/chat/completions \
  -H "Authorization: Bearer $LAYSO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [
      {"role": "user", "content": "用一句话介绍 LAYSO AI"}
    ]
  }'

Verify the response ​

A successful request returns the standard response for the selected protocol. Confirm the response before adding it to your application.

  • For 401, check the API key and authentication header
  • For 403, check the model ID, API key, and account status
  • For 429, reduce concurrency and retry with exponential backoff

Next steps ​

  • Review API key storage in Authentication
  • Query the Model Catalog for model IDs available to your account
  • Add streaming for long-running generations
  • Configure timeouts, retries, and provider fallback for production

LAYSO AI API 文档