Quickstart

Call InOneAPI with an API key and the public model ID copied from the model detail page. Start with cURL, switch HTTP languages, or use the SDK examples below.

1. Create an API key

Create a personal key in Console → API Keys, or a project and team key in enterprise collaboration. Set supported model, budget and rate restrictions. Authorized users can reveal keys again; they are not shown only once.

export INONEAPI_API_KEY="YOUR_INONEAPI_API_KEY"

In Windows PowerShell use $env:INONEAPI_API_KEY = "YOUR_INONEAPI_API_KEY". Keep keys on your server, outside browser code, repositories and logs.

2. Copy the exact model ID

Copy the model detail ID or data[].id from GET /v1/models. Replace YOUR_MODEL_ID below with that complete value.

No provider prefix is required. If the page displays deepseek-v4-flash, send deepseek-v4-flash. Preserve a slash only when it is part of the published ID. Do not add a provider name or substitute an upstream model ID. Model detail examples already contain the selected ID.

3. Send an HTTP request

These examples share their generator with model detail pages. cURL is selected by default. JavaScript/TypeScript require Node.js 20+, Python uses the standard library, Go includes main, and Java requires Java 17+.

X-APP-NAME and X-APP-URL are optional and commented out. The cURL comments show optional flags to add; do not put comment lines inside a backslash-continued command.

# -H "X-APP-NAME: Your App Name"
# -H "X-APP-URL: https://your-app.example.com"
curl "https://api.inoneapi.com/v1/chat/completions" \
  -H "Authorization: Bearer $INONEAPI_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "YOUR_MODEL_ID",
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ]
}'

4. Or use an official SDK

Install npm install openai for Node.js or python -m pip install openai for Python. Set baseURL/base_url to https://api.inoneapi.com/v1.

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.INONEAPI_API_KEY,
  baseURL: "https://api.inoneapi.com/v1",
  defaultHeaders: {
    // "X-APP-NAME": "Your App Name",
    // "X-APP-URL": "https://your-app.example.com",
  },
});

const response = await client.chat.completions.create({
  model: "YOUR_MODEL_ID",
  messages: [
    {
      role: "user",
      content: "Hello",
    },
  ],
});

Read response.choices[0]?.message.content in Node.js or response.choices[0].message.content in Python. SDKs wrap the same API and use the same model IDs and permissions. See SDK setup for other protocols.

5. Verify and continue

Check the HTTP status, output and console usage. Record X-Gateway-Trace-ID; add -i to cURL to inspect headers. A listed model does not support every protocol or parameter. Check its detail page. Balance and budget errors normally use 402; rate limits use 429. See errors.

Documentation · InOneAPI