Skip to main content
This page explains how to call Moxus AI from outside the web app with an API key you create, such as from server-side code, cURL, SDKs, or external tools.
Conversation is a web testing surface. After you sign in, it uses an internal virtual key automatically. You do not need to paste your newly created API key into Conversation. The sk- key you create is for external code, SDKs, scripts, and external tools.

Flow

1

Sign in

Go to https://moxus.cloud and sign in with email or an enabled third-party login provider.
2

Prepare balance

Open Billing and confirm that your account has usable balance from top-up, a redemption code, or a platform grant.
3

Create an API key for external calls

Open API Keys and create a key that starts with sk-. This key is for external code, SDKs, scripts, and external tools, not a required Conversation setting.
4

Choose a protocol and model

Open Model Square, copy the exact model name, and choose the matching Base URL and request format for your protocol.
5

Send an external request

Send the request with cURL or the SDK that matches your protocol. Most projects can start with the OpenAI SDK.
API keys are only shown in full when created. Copy the key immediately and never commit it to frontend code, public repositories, screenshots, or shared chat messages.

Choose a request style

Each protocol has its own Base URL, authentication method, and request body. Do not send an OpenAI request body to the Anthropic or Google native endpoints.

Without an SDK: direct HTTP

To verify that your key, model, and endpoint work, you can send a plain HTTP request without installing an AI SDK. Choose the example that matches your protocol: OpenAI, Anthropic, and Google-compatible calls use different URLs, authentication methods, and request bodies. Every example places the key directly in the code, so no terminal or configuration-file environment setup is required. Replace sk-your-key in the selected example with your actual key.
OpenAI-compatible calls are the most common path for chat, tools, and SDK migrations. Use https://moxus.cloud/v1/chat/completions with Authorization: Bearer ....

SDK setup

SDKs assemble the HTTP request for you. When connecting an SDK to Moxus AI, confirm three settings: For a first call, start with the OpenAI SDK. Use the Anthropic SDK or Google SDK when your project specifically expects Claude-native Messages or Google-native request formats.
To make the first call easy, the examples place the key directly in an API_KEY variable. After copying, replace only sk-your-key and run the file. Do not commit a file containing a real key to a public repository or share it. For production, move the key to environment variables or server-side secret management.
For dependency installation, choose either npm or pnpm; they are alternatives.

OpenAI SDK

If you are unsure which style to use, start with the OpenAI-compatible API. It works for most model calls, SDKs, and external tools. Install dependencies:
Copy the code below into openai_example.py for Python or openai-example.ts for TypeScript.

Anthropic SDK

Use the Anthropic SDK when your project already uses Claude-native Messages. Set Base URL to https://moxus.cloud; the SDK appends /v1/messages. Install dependencies:
Copy the code below into anthropic_example.py for Python or anthropic-example.ts for TypeScript.

Google SDK

Use the Google GenAI SDK when your project expects Google-native request formats. For the Google SDK, set base_url / baseUrl to https://moxus.cloud and set the API version to v1beta; do not repeat /v1beta in the SDK Base URL. Install dependencies:
Copy the code below into google_example.py for Python or google-example.ts for TypeScript.

Verify the request

After an external request succeeds, open Usage and check API activity records for request time, API key, model name, input tokens, output tokens, total tokens, and cost. Calls from Conversation also appear in logs, but they use the platform’s internal virtual key. To verify your external API key, run one of the cURL or SDK examples on this page.

Common first-call errors

Next steps