Keep your OpenAI code. Change two values.

Set base URL to asAi, keep your SDK workflow, pick any available model alias.

from openai import OpenAI
client = OpenAI(api_key="asai_sk_...",
                base_url="https://serveras.click/v1")
client.models.list()
Malaysian prepaid pricing
54 available modelslive catalog
4 free modelsno asAi credit charge
1.05M max contextlargest current window
1 prepaid balanceshared across models

The two values.

Migration from an existing OpenAI integration is a configuration change, not a rewrite. Replace the endpoint host and the credential, keep every request shape and retry helper you already tested. The catalog, billing formula and request log stay the same for all models.

Compatibility values for asAi
FieldValue for asAiHow to handle it
base_urlhttps://serveras.click/v1Set once in client construction, never per request.
api_keyasai_sk_...Read from an environment variable at runtime, never commit it.
modelasai/...Use the catalog id as-is, including the prefix.

Python uses the first console block on this page. The same two values work for curl when the header carries the bearer key and the path targets /v1/chat/completions. Keep timeouts, retries and logging from your current client; only the host and credential change.

curl https://serveras.click/v1/chat/completions -H "Authorization: Bearer asai_sk_..." -H "Content-Type: application/json" -d '{"model":"asai/gpt-6-sol","messages":[{"role":"user","content":"Hello"}]}'

Teams on Codespaces, shared runners or office machines in Kuala Lumpur and beyond can store the key once as a repository secret and reuse this exact block across services. Nothing in the request identifies a region; billing stays in MYR no matter where the code executes.

List models live.

Model aliases retire and replacements arrive without a version bump, so hardcoding a list invites 404 errors weeks later. Call GET /v1/models at deploy time or in a startup check, then select an id from the response. Use the value verbatim, prefix included, because gpt-6-sol without the asai/ prefix is not the same alias.

The catalog response also carries context length, maximum output, input modalities and billing mode per alias. Build prompts against those limits instead of assuming every model accepts images or long documents. The browser view at Models renders the same document in a searchable table.

Document input follows the same schema: an alias whose input_modalities includes file accepts a {"type": "file"} content part carrying a base64 data URL. One limit applies across the catalog: 100,000 characters of document text per request, at most five documents. An oversized document is rejected with a 400 before any credit is reserved, so nothing is charged for it.

Consistent request handling.

Because the gateway faithfully implements the OpenAI Chat Completions schema, features like streaming, structured JSON output and tool calling work as expected when the underlying model supports them. The response structure remains identical whether you use Kimi K3, DeepSeek V4 or a local free model, ensuring your parsing logic never needs conditional branching based on the provider.

When an error occurs, the gateway translates provider-specific failures into standard HTTP status codes and OpenAI-style error objects. A depleted balance returns a standard 402 Payment Required, a rate limit hit returns a 429, and a missing model returns a 404, allowing your existing exponential backoff and retry handlers to function normally without new rules.

Claude Code and Codex note.

Hermes, Claude Code and Codex all speak to asAi through the same key and prepaid balance, but each client expects a different compatibility document. Claude Code follows the Messages-compatible flow in the Claude Code guide, while Codex follows the Responses-compatible flow in the Codex guide. Use this page for plain OpenAI SDK traffic and switch to the dedicated guide when the client complains about request shape.

Malaysian developers commonly keep one provider entry per client rather than one shared entry. That habit makes per-client failures easier to isolate in Logs, because each request carries its own model alias and timestamp.

Secure your key.

Treat the key like a database password. Read it from the environment at process start, scope repository secrets to the environments that need them, and never paste it into chat, screenshots, tickets or generated code samples. A key that appeared anywhere public should be revoked in the dashboard and replaced immediately.

In GitHub Codespaces, store the value as a codespace secret and export it into the shell before running the SDK, instead of writing it into a checked-in .env file. Each developer can hold a labelled key under API keys, and the account stays under the three-key limit when old keys are revoked after rotation.

Billing in credits.

RM5 pack gives 80,000,000 credits for 720 hours. No subscription. Every available model shares the same balance at its published input, cache and output rates.

  1. Illustrative example A: 200 input + 650 output tokens on asai/gpt-6-sol = 34,500 credits, about RM0.00216, about 2,318 similar requests per RM5 pack.
  2. Illustrative example B: 10,000 input + 1,000 output tokens on asai/claude-opus-5 = 225,000 credits, about RM0.01406, about 355 similar requests per RM5 pack.
  3. Illustrative example C: 100 input + 1,500 output tokens on asai/deepseek-v4-pro = 38,000 credits, about RM0.00238, about 2,105 similar requests per RM5 pack.

Recheck exact multipliers in Billing before you publish cost claims. Actual deduction depends on cache and generated output.

The same prepaid balance funds every compatible client, so a Hermes session, a Claude Code run and a direct SDK call all deduct from one pool. Read the multiplier table in Billing, estimate with the examples above, and confirm actual spend in Logs before scaling traffic.

OpenAI-compatible API FAQ.

Which base URL do I set?

Set base_url to https://serveras.click/v1. Keep serverasai.com for the account website and dashboard only.

Which API key does the SDK need?

Create a key under API keys. It starts with asai_sk_. Store it in an environment variable, never in tracked code.

How do I list available models?

Call GET /v1/models and use the returned id value as-is, including the asai/ prefix. Confirm aliases in Models before depending on them.

Does the same key work for Claude Code and Codex?

Yes, with the right compatibility setup. Claude Code uses the Messages-compatible guide, while Codex uses the Responses-compatible guide.

How is usage billed?

Every request deducts credits from one prepaid balance using the model input, cache and output multipliers. Read the formula in Billing and inspect each call in Logs.

Paying in ringgit instead? See AI API for Malaysia. Connecting an agent? Read Setup Hermes Agent di Malaysia dengan asAi or the English technical guide.

Start with RM5