Skip to content

LAYSO AI CLI ​

Connect LAYSO AI CLI to leading AI models through LAYSO AI. This article uses native VitePress Markdown so the on-page outline can index every step.

One key for every platform model

LAYSO AI bills at the selected model's current price. Every successful request has an itemized charge; failed tasks are not charged.

Before you begin ​

  • Category: Quick setup tool
  • Recommended protocol: OpenAI / Anthropic / Gemini
  • Create an API key in the LAYSO AI dashboard.
  • Copy an exact model ID from the dashboard catalog; do not guess aliases.

Configure LAYSO AI ​

FieldValue
ProviderLAYSO AI
Base URLhttps://api.layso.ai/v1
API key / environmentLAYSO_API_KEY
Request headerAuthorization: Bearer $LAYSO_API_KEY
Model<MODEL_ID>

Save the settings and restart the client so the provider and environment variables are reloaded.

Install and launch ​

bash
npm install -g laysoai
laysoai

First request ​

Use a minimal request to validate the API key, network path, and model ID before starting a long task.

bash
curl https://api.layso.ai/v1/models \
  -H "Authorization: Bearer $LAYSO_API_KEY"

After it succeeds, send a short client prompt and confirm the returned model matches the dashboard selection.

Authentication and troubleshooting ​

Checklist ​

  1. Confirm the key has no missing characters, spaces, or line breaks.
  2. Ensure the Base URL does not repeat /v1, or /v1beta.
  3. Fully quit and reopen the terminal or client so environment variables reload.
  4. Refresh the model catalog and copy the exact model ID.
  5. Never expose a full key in screenshots, logs, examples, or repositories.

Common errors ​

IssueWhat to check
401 / 403API key, environment variable, and protocol-specific request header.
404Missing or duplicated protocol path in the Base URL.
Unknown modelUse the exact ID displayed in the dashboard catalog.
No charge recordConfirm the task succeeded; failed tasks are not charged.

Billing and security ​

  • One LAYSO AI API key can access all platform models.
  • Every successful request has an itemized charge in task details.
  • Failed tasks are not charged.
  • Keep the key in local environment variables or the client's secure storage.

LAYSO AI API 文档