Skip to content

OpenAI

Through the OpenAI forward service we provide, you can simply use OpenAI's official API and library.

OpenAI Official Service Status

Pricing & Billing

Due to rising costs, the prices on this platform are temporarily unified to [official original price] (https://openai.com/pricing).

How to count the tokens consumed

Token is the smallest unit for large language models to process. You can Online Tokens Calculator

Please refer to actual consumption for details.

Supported Models

gpt-4ogpt-4o-2024-05-13gpt-4-turbogpt-4-turbo-2024-04-09gpt-4-vision-previewgpt-4-1106-previewgpt-4gpt-4-32kgpt-3.5-turbogpt-3.5-turbo-0125gpt-3.5-turbo-0301gpt-3.5-turbo-0613gpt-3.5-turbo-1106gpt-3.5-turbo-16kgpt-3.5-turbo-16k-0613gpt-3.5-turbo-instructtext-embedding-ada-002text-embedding-3-smalltext-embedding-3-largedall-e-2dall-e-3tts-1tts-1-1106tts-1-hdtts-1-hd-1106

How to Use

For developers

Developers only need the following two steps to use it simply

  1. Fill in the API Key of ours platform
  2. Use ours forward service Base URL: https://apiok.us/api/openai/v1

The API usage is completely consistent with the OpenAI official API. The example is as follows. Only the code highlights need to be changed:

shell
curl https://apiok.us/api/openai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $iDataRiver_API_KEY" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant."
      },
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }'
python
from openai import OpenAI

client = OpenAI(
  api_key='idr_******', 
  base_url='https://apiok.us/api/openai/v1'
)

completion = client.chat.completions.create(
  model="gpt-3.5-turbo",
  messages=[
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Hello!"}
  ]
)

print(completion.choices[0].message)
js
import OpenAI from "openai";

const openai = new OpenAI({
  apiKey: 'idr_****',
  baseURL: 'https://apiok.us/api/openai/v1',
});

async function main() {
  const completion = await openai.chat.completions.create({
    messages: [{ role: "system", content: "You are a helpful assistant." }],
    model: "gpt-3.5-turbo",
  });

  console.log(completion.choices[0]);
}

main();

For more use cases and usage, please refer to OpenAI Official API Documentation

For third products use

If you are using third-party products such as: ChatHub, OpenAI Translator, Lobe-Chat, ChatGPT Next Web or other apps and browser extensions, only a few simple operations need todo.

Fill in the following two items in the OpenAI configuration field of the application or browser extensions:

  1. Ours API Key
  2. Ours forward service Base URL: https://apiok.us/api/openai/v1

Error codes

CODEOVERVIEW
400Bad Request, 请求格式错误或不能被服务器理解。通常意味着客户端错误。
401Unauthorized. Ensure the API key used is correct,.
403Forbidden
404Not Found
413Request Entity Too Large
429Too Many Requests. Pace your requests
500Internal Server Error. Issue on OpenaAI servers. Retry your request after a brief wait and contact us if the issue persists.。
503Service Unavailable. OpenAI's servers are experiencing high traffic. Please retry your requests after a brief wait.

For more details, please refer to OpenAI Official API Error Code

Make things simple and timeproof.