Tool guides / OpenAI SDK

DocsTool guidesOpenAI SDK

OpenAI SDK

The official OpenAI libraries for Python and Node.js. Change the base URL to https://intl.acctoken.com/v1 and keep the rest.

Root URLhttps://intl.acctoken.com+ /v1https://intl.acctoken.com/v1Full paththe whole endpoint, e.g. https://intl.acctoken.com/v1/chat/completions

On this page
  1. Connection details
  2. Set it up
  3. Responses API
  4. Streaming
  5. Check it works
  6. Common problems

Before you start

  • An ACCTOKEN API key. Create one on API Keys in the console.
  • Python with pip install openai, or Node.js with npm install openai.

01Connection details

CONNECTION RECORDOPENAI SDK
Format
Chat Completions, Responses
Base URL
https://intl.acctoken.com/v1+ /v1
API key
YOUR_API_KEYapi_key / apiKey
Model
deepseek-v4.1-flash
Environment
OPENAI_BASE_URLOPENAI_API_KEY
LIVE CHECKCommands run on the live APIEvery command on this page is run against intl.acctoken.com before it is published.ACCTOKEN DOCS DESK

02Set it up

Point the client at the /v1 base URL. The rest of your code stays as it is.

from openai import OpenAI client = OpenAI( base_url="https://intl.acctoken.com/v1", api_key="YOUR_API_KEY",) resp = client.chat.completions.create( model="deepseek-v4.1-flash", messages=[{"role": "user", "content": "Say hello in one word."}],)print(resp.choices[0].message.content)
Install with pip install openai.

Responses API

The same client calls the Responses API. It works with GPT models and the DeepSeek, Qwen, GLM, Kimi, MiniMax and MiMo models.

resp = client.responses.create(model="gpt-6.1-sol", input="Say hello in one word.")print(resp.output_text)

Streaming

Pass stream=True in Python or stream: true in Node.js. Streaming works as in the OpenAI API; the last chunk carries usage even if you did not ask for it.

03Check it works

With the two environment variables set, run:

python -c "from openai import OpenAI; print(OpenAI().chat.completions.create(model='deepseek-v4.1-flash', messages=[{'role': 'user', 'content': 'Reply with exactly: OK'}]).choices[0].message.content)"
Expected outputOK

Common problems

Unexpected token '<', or an HTML page

base_url is missing /v1.

404

Invalid URL (POST /v1/v1/chat/completions)

base_url has /v1 twice.

401

Invalid token

Check the key you pass, or OPENAI_API_KEY if you rely on the environment.

403

Insufficient balance: $0.00 remaining. New requests are declined until you add balance

Add balance in Wallet. These requests are not recorded in Usage Logs.

The request times out before the reply arrives

Some models, GPT models in particular, can take up to about three minutes to answer without streaming. If you set a timeout on the client, make it 300 seconds or more, or stream the response.

Something else? Look up the exact message in Errors.