API Manual
wylon Token Factory exposes an OpenAI-compatible inference API. All endpoints share the same base URL and authentication scheme. This section documents request parameters, response shapes, and multi-language code samples for each endpoint.
Basics
Base URLstring
https://api.wylon.cn/v1AuthHTTP Bearer
Every request must carry
Authorization: Bearer wl-.... Manage keys in the dashboard.Content-Typestring
JSON requests use
application/json; file uploads use multipart/form-data; streamed responses are text/event-stream.Compatibilityprotocol
Paths and field names follow the OpenAI protocol exactly. You can use the official
openai SDKs or any OpenAI-compatible client by swapping base_url and api_key.Endpoints
Text-only endpoints currently exposed by wylon.
| Group | Method & path | Purpose |
|---|---|---|
| Chat & completions | POST/chat/completions | Conversational generation (streaming, tools, structured output) |
| Embeddings | POST/embeddings | Text vector embeddings |
| Rerank | POST/rerank | Re-rank candidate documents by query relevance |
| Models | GET/models | List models available to your account |
| Batch (coming soon) | POST/batches | Create a batch job |
GET/batches/{id} | Retrieve job status | |
POST/batches/{id}/cancel | Cancel a batch job |
Error envelope
Errors use the OpenAI-compatible envelope:
Error response
{
"error": {
"type": "invalid_request_error",
"message": "…",
"code": "invalid_api_key"
}
}
Common HTTP statuses: 400 bad request / 401 authentication failed / 403 forbidden /
429 exceeded a rate limit /
500, 503 transient server errors. See each endpoint page for details.