Documentation
KHaiXAPI Documentation
Find text and image API URLs, authentication methods, and integration examples here. You can send HTTP requests directly or use the following pages to configure SDKs, coding agents, or desktop clients.
Choose an Integration
Call the Text API DirectlyView protocols, request fields, response structures, and cURL examples Call the Image APIGenerate and edit images with OpenAI gpt-image-2 Use an SDK in Your CodeOpenAI Python, JavaScript, Vercel AI SDK, and LangChain Configure a Coding AgentCodex, OpenCode, Hermes, Cline, Kilo, OpenClaw, and more Configure a Desktop or Web ClientCherry Studio, Open WebUI, CC Switch, Claude Code, and other clients
Get Started in Three Steps
- Create a key: Open “API Keys” in the console and create a dedicated key for the current application.
- Confirm the model: Check the currently available text or image models, prices, groups, and image-generation permissions in the console.
- Send a minimal request: For text, verify Responses first. For images, verify generations first, then add edit, streaming, or asynchronous parameters.
curl https://api.khaix.net/v1/responses \
-H "Authorization: Bearer sk-replace-with-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.6-sol",
"input": "Reply with: connection successful"
}'An HTTP 200 response with text output, together with the corresponding console record, confirms that the key, URL, and model are configured correctly.
URLs and Authentication
| Purpose | URL | Description |
|---|---|---|
| OpenAI SDK Base URL | https://api.khaix.net/v1 | Lets the SDK append request paths automatically |
| Responses | POST /v1/responses | For Codex and clients that support Responses |
| Chat Completions | POST /v1/chat/completions | For general OpenAI-compatible clients |
| Anthropic Messages | POST /v1/messages | For Claude Code and Messages clients |
| Images generations | POST /v1/images/generations | OpenAI gpt-image-2 image generation |
| Images edits | POST /v1/images/edits | Image editing and masks |
OpenAI-compatible requests use Authorization: Bearer YOUR_API_KEY. Before entering a URL, confirm whether the application expects the site root, a Base URL, or a complete endpoint. Only a Base URL requires the application to append the request path.
Documentation Conventions
- Models in the examples demonstrate configuration formats. Refer to the console for available models, prices, and multipliers.
- Start with a basic request without reasoning effort, tools, or structured output. Add parameters one at a time after confirming connectivity.
- A
Base URLis the address to which an SDK appends a path; anendpointis the final HTTP request URL. - Client interfaces may change between versions. Follow the protocol and URL specified on each integration page.
- See the Billing Guide for billing rules and the API Relay Guide for service boundaries.