Developer API
OpenAI-compatible API: integration and compatibility guide
EasyAI is designed for teams that want to keep familiar OpenAI SDKs and request shapes while accessing models enabled for their account. Compatibility is endpoint- and model-specific, so production integration still requires contract tests.
Direct answer
EasyAI provides an OpenAI-compatible API for supported endpoints: configure an OpenAI client with the EasyAI base URL and API key, then select a model returned by GET /v1/models. Verify each required parameter, streaming event, tool call, error, and usage field before treating an upstream model as production-compatible.
Verified facts
- Client setup
- Use an OpenAI client that supports a custom base URL
- Authentication
- Send an EasyAI API key from server-side code
- Model IDs
- Read current account availability from GET /v1/models
- Compatibility scope
- Endpoint, parameter, streaming, tool, and error behavior remain model-specific
- Fact check
- Reviewed against EasyAI product and integration sources on 2026-09-12
Connect an OpenAI SDK to EasyAI
Create the client with a server-side EasyAI key and the base URL documented in Quickstart. Keep the base URL, model ID, and key configurable so staging, production, and rollback do not require code changes.
Discover model IDs from the live catalog or GET /v1/models. Do not assume that a provider's public model name is enabled or mapped identically for every account.
Define compatibility with contract tests
Test every field your application depends on: messages, system instructions, structured output, tools, streaming chunks, usage values, timeouts, rate limits, and error bodies. Run the fixture against the exact model and endpoint you will deploy.
Record unsupported fields explicitly and decide whether the client will reject, omit, or transform them. This prevents a compatibility label from hiding behavior that changes application results.
Operate the gateway safely
Keep API keys off the browser, rotate them through the console, cap retries, and log request identifiers without secrets. Monitor latency, errors, token or generated-item usage, and effective account cost.
Choose a fallback only after testing it with the same fixture. A fallback model with a different schema or output quality is a product decision, not only a routing setting.
Integration example
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.EASYAI_API_KEY,
baseURL: process.env.EASYAI_BASE_URL,
});
const models = await client.models.list();
const response = await client.chat.completions.create({
model: process.env.EASYAI_MODEL!,
messages: [{ role: "user", content: "Return a compatibility check." }],
});Who this is for
Product teams that need a consistent integration surface across model providers.
Get an API keyFrequently asked questions
Which SDKs can connect?
Any client that allows a custom OpenAI base URL can connect, including the official Python and Node packages, curl, and compatible orchestration tools.
Are all OpenAI endpoints supported?
Support depends on the endpoint and model. Check the compatibility document and the model's endpoint list before relying on a feature.
How is usage charged?
Text models are metered by token units; image and video models may be billed per generated item. The current pricing page explains the reference units.
Does OpenAI-compatible mean every parameter behaves identically?
No. It describes a compatible request surface for supported endpoints, not guaranteed feature parity. Test required parameters and response fields for the selected model.
Where should I store the EasyAI API key?
Store it in server-side secrets or environment configuration. Never ship a privileged API key in browser JavaScript or a public repository.
How do I migrate an existing OpenAI client?
Move the base URL, API key, and model ID into configuration, run your contract fixture in staging, and shift traffic only after response, error, latency, usage, and cost checks pass.
Sources and freshness
- EasyAI Quickstart · checked 2026-09-12
- EasyAI compatibility notes · checked 2026-09-12
- EasyAI error handling · checked 2026-09-12
- EasyAI API key safety · checked 2026-09-12
Planning a larger workload?
Enterprise volume purchases can qualify for better pricing. Request a quote for your models and scale.