Ads for Credits All clients Docs FAQ

Using Ads for Credits with the OpenAI SDK

Last updated 2026-08-31

The official OpenAI libraries take a base URL argument. Change that one argument and the key, and everything else in your code stays exactly as it is.

The three values

Every client needs the same three. Sign in and take them from the console.

  • Base URL — https://onomeo.com/v1
  • API key — the key shown in your console, starting ac-
  • Model — one of the names on the models page

Step by step

  1. Install the official library as usual — no fork, no wrapper.
  2. When constructing the client, pass the base URL argument set to ours.
  3. Pass your key as the API key argument. Read it from an environment variable rather than writing it into the source.
  4. Use a model name from the models page in your calls.

What is and is not supported

Chat completions work, including streaming. The request and response shapes are the standard ones, so libraries built on top of the SDK generally work unchanged.

Endpoints beyond chat — images, audio, embeddings, assistants — are not provided. Calls to those will not find anything at this base URL.

Keep the key out of anything you commit. A key seen in use from several places at once gets disabled, and a key pushed to a public repository will be found.

Checking it worked

Send one short request and print the reply. Then check the console: the call and the tokens it consumed appear in recent usage.

If it does not connect

A 401 usually means the key was copied with a trailing space. A 404 means the base URL has /v1 twice or not at all — try it the other way. A 400 saying the model is not allowed means the tool sent its own default name instead of one of ours. The full table is on the clients page.


在 OpenAI SDK 中使用

最后更新 2026-08-31

OpenAI 官方库支持传入接口地址参数。只需修改该参数与密钥,代码的其余部分无需任何改动。

需要填的三个值

所有客户端要的都是这三个。登录后在控制台获取。

  • 接口地址 — https://onomeo.com/v1
  • 密钥 — 控制台中显示的密钥,以 ac- 开头
  • 模型名称 — 模型页面所列名称之一

操作步骤

  1. 照常安装官方库,无需使用分支版本或封装库。
  2. 构造客户端时,将接口地址参数设为本站地址。
  3. 将密钥传入 API 密钥参数。建议从环境变量读取,不要写入源代码。
  4. 调用时使用模型页面上列出的模型名称。

支持与不支持的功能

对话补全可正常使用,包括流式输出。请求与响应格式均为标准格式,因此基于该 SDK 构建的库通常无需改动即可使用。

对话以外的接口——图像、音频、向量嵌入、Assistants——本服务不提供,调用这些接口将无法在本接口地址下找到对应资源。

请勿将密钥提交到代码仓库。同一密钥在多处同时使用将被停用,而推送到公开仓库的密钥一定会被他人发现。

如何确认配置成功

发送一条简短请求并打印返回结果,随后查看控制台。该次调用及其消耗的 token 数会出现在最近用量中。

连接失败时

返回 401 通常是密钥复制时末尾带了空格;返回 404 是接口地址中 /v1 重复或缺失,改成另一种写法即可;返回 400 且提示模型不被允许,说明客户端发送的是它自带的默认模型名,需手动填写本站的名称。完整对照表见客户端总览。