OpenAI bilan mos chat
OpenAI SDKʼni NeuronAIʼga yoʻnaltiring va tashkilotingiz uchun ochiq modellardan chat javoblarini oling.
Qanday ishlaydi
- 01
Mijozning asosiy URL manzilini
https://my.neuronai.uz/api/v1qilib belgilang. - 02
Model identifikatorlari roʻyxatini
GET /modelsorqali oling. - 03
messagesmassiviniPOST /chat/completionsga yuboring, oqimli javob uchunstream: trueqoʻshing.
Autentifikatsiya
OpenAI SDKʼlari kalitni Authorization: Bearer sifatida yuboradi, shuning uchun NeuronAI kalitingizni SDKʼning API kaliti sifatida koʻrsating. Modellar roʻyxati uchun llm:read, chat uchun llm:write ruxsati kerak.
Namuna
Soʻrov va javoblar chat completions shaklini saqlaydi, shuning uchun ilovani oʻtkazish uchun uning sozlamalarini oʻzgartirish kifoya. Xatolar OpenAIʼning xato obyektida, qoʻshimcha request_id bilan keladi.
API maʼlumotnomasi
Har bir endpoint uchun soʻrov maydonlari, javoblar, narxlar va kod namunalari hamda haqiqiy soʻrov yuboradigan shakl.
Faqat brauzeringizda saqlanadi.
LLM
OpenAI-compatible chat completions. Point any OpenAI SDK at this base URL and authenticate with your API key.
POST /v1/chat/completions
Create chat completion
Generates a model response for a chat conversation. OpenAI-compatible — set your OpenAI SDK's base URL to `{app}/api/v1` and use your API key. Set `stream: true` for a Server-Sent Events stream of `chat.completion.chunk` objects ending with `[DONE]` (the chunk before it carries `usage` when the model reports its token counts). Billed per token (prompt + completion).
Pricing
per 1K tokens- Input
- 1.5 credits
- Output
- 6 credits
Soʻrov tanasi
| Maydon | Tavsif |
|---|---|
modelMajburiystring | maxLen: 128 |
max_tokensinteger | null | min: 1 |
temperaturenumber | null | min: 0 · max: 2 |
top_pnumber | null | min: 0 · max: 1 |
stopobject | Text at which the model stops: one string, or a list of strings (OpenAI's `stop`). Sent to the model exactly as given, byte for byte, including a string of only whitespace such as `\n`. |
streamboolean | null | |
messagesMajburiyobject[] |
Javoblar
| Sarlavha | Tavsif |
|---|---|
X-Costnumber | The price billed, in credits. Sent with the JSON completion; a stream is billed when it ends, so it carries none. |
X-Accel-Bufferingstring | Sent as `no` with a stream: it tells a proxy such as nginx not to hold back the events. |
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
| Maydon | Tavsif |
|---|---|
idMajburiystring | |
objectMajburiystring | |
createdMajburiyinteger | |
modelMajburiystring | |
choicesMajburiyobject[] | |
usageMajburiyobject |
X-Request-Id: string| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
| Sarlavha | Tavsif |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
| Sarlavha | Tavsif |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
| Sarlavha | Tavsif |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
| Sarlavha | Tavsif |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
| Sarlavha | Tavsif |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
Retry-Afterinteger | Seconds to wait before retrying. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
X-RateLimit-Resetinteger | When the rate limit lets requests through again, as a Unix time in seconds. Sent with a 429 for `rate_limit_exceeded`. |
| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
| Sarlavha | Tavsif |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
| Sarlavha | Tavsif |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
Retry-Afterinteger | Seconds to wait before retrying. Sent with a 503 during maintenance, when a retry time was set. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
Namunalar
Sinab koʻrish
Kalit bilan soʻrov yuborish uchun API kalitingizni yuqoridagi panelga kiriting.
GET /v1/models
List models
Lists the chat models available to your account.
Javoblar
| Sarlavha | Tavsif |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
| Maydon | Tavsif |
|---|---|
objectMajburiystring | |
dataMajburiyobject[] |
X-Request-Id: string| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
X-Request-Id: string| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
| Sarlavha | Tavsif |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
Retry-Afterinteger | Seconds to wait before retrying. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
X-RateLimit-Resetinteger | When the rate limit lets requests through again, as a Unix time in seconds. Sent with a 429 for `rate_limit_exceeded`. |
| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
| Sarlavha | Tavsif |
|---|---|
X-Request-Idstring | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |
Retry-Afterinteger | Seconds to wait before retrying. Sent with a 503 during maintenance, when a retry time was set. |
X-RateLimit-Limitinteger | The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused. |
X-RateLimit-Remaininginteger | How many of them are left this minute. |
| Maydon | Tavsif |
|---|---|
errorMajburiyobject | |
request_idMajburiystring | The same ID as the `X-Request-Id` header. format: uuid |
Namunalar
Sinab koʻrish
Kalit bilan soʻrov yuborish uchun API kalitingizni yuqoridagi panelga kiriting.