SDK setup
Use official SDKs. They handle client requests and responses without changing InOneAPI model IDs, billing or compatibility. These examples share the model detail generator.
Install npm install openai or npm install @anthropic-ai/sdk for Node.js; use python -m pip install openai or python -m pip install anthropic for Python. Replace YOUR_MODEL_ID with the exact catalog ID.
OpenAI Chat Completions
baseURL/base_url: 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",
},
],
});OpenAI Responses
baseURL/base_url: 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.responses.create({
model: "YOUR_MODEL_ID",
input: "Hello",
});Anthropic Messages
baseURL/base_url: https://api.inoneapi.com — /v1/messages is appended by the SDK.
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env.INONEAPI_API_KEY,
baseURL: "https://api.inoneapi.com",
defaultHeaders: {
// "X-APP-NAME": "Your App Name",
// "X-APP-URL": "https://your-app.example.com",
},
});
const message = await client.messages.create({
model: "YOUR_MODEL_ID",
max_tokens: 1024,
messages: [
{
role: "user",
content: "Hello",
},
],
});Model detail pages also provide Go, Java, .NET and Ruby SDK snippets and install commands. Add them to a project with the required SDK imports. Go/Java HTTP examples in API references include a full program entry point. OpenAI Go uses github.com/openai/openai-go/v3.