OpenAI-совместимый HTTP API к модели GhostGPT. Работает по ключу и требует действующей подписки. Веб-чат: ghostgpt.io
OpenAI-compatible HTTP API for the GhostGPT model. Works with an API key and requires an active subscription. Web chat: ghostgpt.io
Главная ссылка для интеграции (Base URL): Main integration link (Base URL): https://api.ghostgpt.io/v1Три шага, каждый занимает минуту.
Three steps, a minute each.
Дальше — настройки клиента:
Then configure your client:
| Поле | Значение |
|---|---|
| Base URL / API URL | https://api.ghostgpt.io/v1 |
| Model | ghostgpt |
| API Key | SK-… (заголовок Authorization: Bearer) |
| Field | Value |
|---|---|
| Base URL / API URL | https://api.ghostgpt.io/v1 |
| Model | ghostgpt |
| API Key | SK-… (Authorization: Bearer header) |
Проверка одной командой — она не тратит квоту:
One-command check — it does not consume quota:
curl https://api.ghostgpt.io/v1/models \
-H "Authorization: Bearer SK-YOUR-KEY"
Машиночитаемый манифест: /api.json
Machine-readable manifest: /api.json
Важно: https://api.ghostgpt.io/v1 — это Base URL для клиента, а не страница в браузере. Документация живёт на /, проверка ключа — на /v1/models.
Note: https://api.ghostgpt.io/v1 is a client Base URL, not a browsable page. Docs live at /; check the key at /v1/models.
Документация открыта всем. Сам API работает, пока подписка оплачена.
The documentation is public. The API itself works while the subscription is paid.
| Состояние | Веб-чат | API по ключу |
|---|---|---|
| Триал (3 дня) | 100 сообщений в сутки | нет — ключ выдаётся только после оплаты |
| Оплачено | 300 сообщений в сутки (региональный тариф — 50) | 250 из тех же 300 (на региональном — вся норма 50) |
| Первые 72 часа после конца оплаты | 10 сообщений в сутки | 10 в сутки + заголовок Warning |
| Дальше | 10 сообщений в сутки | 402 subscription_required |
| State | Web chat | API key |
|---|---|---|
| Trial (3 days) | 100 messages/day | none — keys are issued after payment |
| Paid | 300 messages/day (regional plan — 50) | 250 out of the same 300 (regional — the whole 50) |
| First 72h after expiry | 10 messages/day | 10/day + Warning header |
| After that | 10 messages/day | 402 subscription_required |
Пул общий. Ключ и браузер черпают из одной суточной квоты аккаунта. На стандартном тарифе ключу отдано 250 из 300, чтобы ночной скрипт не оставил вас без чата утром: 50 сообщений остаются веб-интерфейсу. На региональном тарифе (Индия, Пакистан, Бангладеш, Нигерия, Индонезия, Вьетнам) норма — 50 сообщений в сутки, и ключ может выбрать её целиком: резерва для браузера там нет.
One shared pool. The key and the browser draw from the same daily account quota. On the standard plan the key gets 250 out of 300 so that a nightly script cannot leave you without the chat in the morning: 50 messages stay reserved for the web UI. On the regional plan (India, Pakistan, Bangladesh, Nigeria, Indonesia, Vietnam) the allowance is 50 messages a day and the key may use all of it: nothing is reserved for the browser there.
72 часа после истечения — не подарок, а защита от простоя: подписка может кончиться в три часа ночи, и ваш продакшен обязан дожить до утра. В эти часы каждый ответ несёт заголовок Warning: 199 ghostgpt "…", а лимит падает до бесплатного.
The 72-hour window is not a gift but downtime protection: a subscription can expire at 3 a.m., and your production must survive until morning. During that window every response carries Warning: 199 ghostgpt "…" and the limit drops to the free tier.
После новой оплаты ключ оживает сам — перевыпускать его не нужно, доступ считается по сроку подписки. Оплаченные дни складываются с остатком, а не заменяют его.
After a new payment the key comes back on its own — no re-issue needed, access follows the subscription date. Paid days are added to whatever is left, not substituted for it.
Цены и сроки — на странице доступа. Оплата разовая: автосписаний нет, карта не привязывается.
Prices and terms are on the access page. Payments are one-off: no recurring charges, no stored cards.
Authorization: Bearer SK-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
key_id вида K7ZQ3M2X1. Он не секретен: по нему поддержка находит вашу запись, не спрашивая сам ключ. Тот же key_id возвращается заголовком X-GhostGPT-Key-Id.key_id such as K7ZQ3M2X1. It is not secret: support can find your record without ever seeing the key. The same value comes back in the X-GhostGPT-Key-Id header.Через интерфейс — на странице доступа. Через HTTP (нужна cookie сессии, то есть вход по токену):
Through the UI — on the access page. Over HTTP (requires the session cookie, i.e. sign-in by token):
| Метод | Путь | Что делает |
|---|---|---|
| GET | ghostgpt.io/api/access/apikey | Есть ли ключ, когда создан, когда им пользовались. Секрета не отдаёт. |
| POST | ghostgpt.io/api/access/apikey | Выдать или перевыпустить. Требует оплаченной подписки, иначе 402. |
| POST | ghostgpt.io/api/access/apikey/revoke | Погасить ключ. Действует немедленно. |
| Method | Path | What it does |
|---|---|---|
| GET | ghostgpt.io/api/access/apikey | Whether a key exists, when it was created and last used. Never returns the secret. |
| POST | ghostgpt.io/api/access/apikey | Issue or rotate. Requires an active subscription, otherwise 402. |
| POST | ghostgpt.io/api/access/apikey/revoke | Revoke the key. Takes effect immediately. |
{
"key": {"key_id": "K7ZQ3M2X1", "created_at": 1787930020, "last_used_at": null},
"tier": "paid",
"paid_until": 1790522020,
"limits": {
"daily_messages": 300,
"api_daily_messages": 250,
"api_daily_out_tokens": 150000,
"grace_seconds": 259200
},
"secret": "SK-…"
}
Поле secret приходит только в ответе на выдачу — больше нигде и никогда.
The secret field appears only in the issue response — nowhere else, ever.
На api.ghostgpt.io (основной адрес), на ghostgpt.io — второй оставлен для клиентов, заведённых до появления отдельного домена, — и на onion-зеркале (см. ниже). Cookie веб-чата работает на ghostgpt.io, app.ghostgpt.io и на зеркале, но не на api.ghostgpt.io.
On api.ghostgpt.io (the main address), on ghostgpt.io — the latter is kept for clients set up before the separate domain existed — and on the onion mirror (see below). The web-chat cookie works on ghostgpt.io, app.ghostgpt.io and on the mirror, but not on api.ghostgpt.io.
Если в Authorization положить токен входа (GG-…) вместо ключа, ответ будет 401 use_api_key — это самая частая ошибка первого дня, и она названа отдельно, чтобы вы не искали опечатку.
Putting a sign-in token (GG-…) into Authorization instead of a key returns 401 use_api_key — the most common first-day mistake, named separately so you do not go hunting for a typo.
Тот же API отвечает на onion-зеркале — без выхода в обычный интернет и без DNS:
The same API answers on the onion mirror — with no exit to the ordinary internet and no DNS:
http://ghostgptdcxf76dzznn6wv4gzruvfs4h4bx7rootrwluxxvbtujiueqd.onion/v1
Ключ предъявляется так же, тем же заголовком Authorization; отдельного адреса вида api.…onion нет и не нужно. Схема только http: сертификата для .onion не существует, шифрование и подлинность адреса обеспечивает сама сеть Tor.
The key is presented the same way, in the same Authorization header; there is no separate api.…onion address and none is needed. The scheme is http only: no certificate exists for .onion, and encryption plus address authenticity come from the Tor network itself.
curl --socks5-hostname 127.0.0.1:9050 \
http://ghostgptdcxf76dzznn6wv4gzruvfs4h4bx7rootrwluxxvbtujiueqd.onion/v1/chat/completions \
-H "Authorization: Bearer SK-…" \
-H "Content-Type: application/json" \
-d '{"model":"ghostgpt","messages":[{"role":"user","content":"ping"}]}'
В библиотеке OpenAI достаточно подменить base_url и направить транспорт в SOCKS5-порт Tor (обычно 9050; в Tor Browser — 9150).
With the OpenAI library it is enough to swap base_url and point the transport at Tor's SOCKS5 port (usually 9050; 9150 in Tor Browser).
Предел «запросов в минуту с адреса» на зеркале работает иначе. Адреса клиента там не существует: соединение приходит от локального демона Tor, и по адресу все гости зеркала неотличимы. Поэтому счёт ведётся по cookie входа, а запросы без неё — а это как раз запросы с API-ключом — попадают в общее ведро зеркала. Если вам нужен предсказуемый предел, ходите на api.ghostgpt.io; ограничение «один запрос в момент времени на аккаунт» действует одинаково везде.
The per-IP rate limit works differently on the mirror. There is no client address there: the connection arrives from the local Tor daemon, so by address all mirror visitors are indistinguishable. Counting therefore goes by the sign-in cookie, and requests without one — which is exactly what API-key requests are — fall into the mirror's shared bucket. If you need a predictable limit, use api.ghostgpt.io; the "one request at a time per account" rule applies everywhere alike.
| Свойство | Значение |
|---|---|
| Идентификатор | ghostgpt |
| Псевдонимы | ghostgpt, default, auto |
| Контекст | 32 768 токенов на запрос |
| Ответ | до 16 384 токенов |
| Модальности | текст и изображения на входе, текст на выходе |
| Одна картинка | до 768 токенов |
| Цепочка рассуждений | выключена — ответ приходит сразу |
| Property | Value |
|---|---|
| Identifier | ghostgpt |
| Aliases | ghostgpt, default, auto |
| Context | 32,768 tokens per request |
| Response | up to 16,384 tokens |
| Modalities | text and images in, text out |
| One image | up to 768 tokens |
| Reasoning traces | off — the answer arrives directly |
Любое значение поля model переписывается на текущую модель. Прислали gpt-4o — получите тот же ghostgpt, ошибки не будет. В ответе всегда стоит "model": "ghostgpt".
Whatever you put in model is rewritten to the current model. Send gpt-4o and you still get ghostgpt, without an error. Responses always carry "model": "ghostgpt".
Модель обслуживает два запроса одновременно на весь сервис. Отсюда ограничение «один запрос за раз на аккаунт» — см. Лимиты.
The model serves two concurrent requests for the whole service. Hence the “one request at a time per account” rule — see Limits.
| Метод | Путь | Назначение | Тратит квоту |
|---|---|---|---|
| POST | /v1/chat/completions | Чат — единственная ручка генерации | да, 1 сообщение |
| GET | /v1/models | Список моделей, проверка ключа | нет |
| GET | /health | Жив ли сервис (без ключа) | нет |
| Method | Path | Purpose | Costs quota |
|---|---|---|---|
| POST | /v1/chat/completions | Chat — the only generation endpoint | yes, 1 message |
| GET | /v1/models | List models, verify the key | no |
| GET | /health | Service liveness (no key needed) | no |
Любой другой путь под /v1/ отвечает 404 unknown_endpoint в формате ошибки OpenAI — в том числе /v1/completions, /v1/embeddings, /v1/responses, /v1/messages.
Any other path under /v1/ returns 404 unknown_endpoint in the OpenAI error format — including /v1/completions, /v1/embeddings, /v1/responses, /v1/messages.
/v1/models никогда не отвечает 402. Это ручка, которой библиотеки проверяют связь при старте: отказ по выбранной квоте означал бы, что приложение не может подняться до полуночи UTC, не потратив ни одного токена.
/v1/models never returns 402. Client libraries call it at startup: refusing on an exhausted quota would mean the app cannot even boot until midnight UTC without spending a single token.
Формат — как у OpenAI Chat API. Совместимость проверена на официальном SDK openai для Python и Node без единой правки.
Same shape as the OpenAI Chat API. Verified against the official openai SDK for Python and Node with no changes.
curl https://api.ghostgpt.io/v1/chat/completions \
-H "Authorization: Bearer SK-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "ghostgpt",
"messages": [
{"role": "user", "content": "Hello! What is GhostGPT API?"}
],
"max_tokens": 512
}'
pip install openai
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.ghostgpt.io/v1",
api_key=os.environ["GHOSTGPT_API_KEY"], # ключ — в окружении, не в коде
)
resp = client.chat.completions.create(
model="ghostgpt",
messages=[{"role": "user", "content": "Hello"}],
max_tokens=512,
)
print(resp.choices[0].message.content)
print(resp.usage.completion_tokens) # объём выдачи учитывается всегда
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.ghostgpt.io/v1",
apiKey: process.env.GHOSTGPT_API_KEY,
});
const r = await client.chat.completions.create({
model: "ghostgpt",
messages: [{ role: "user", content: "Hello" }],
max_tokens: 512,
});
console.log(r.choices[0].message.content);
import time, httpx
def ask(client, messages, tries=3):
for i in range(tries):
try:
return client.chat.completions.create(model="ghostgpt", messages=messages)
except httpx.HTTPStatusError as e:
code = e.response.status_code
if code == 429: # свой же параллельный запрос
time.sleep(int(e.response.headers.get("Retry-After", 5)))
continue
if code == 503: # модель занята или перезапускается
time.sleep(int(e.response.headers.get("Retry-After", 5)))
continue
raise # 401 и 402 повторять бессмысленно
raise RuntimeError("giving up")
Повторять стоит только 429 и 503. 401 означает неверный ключ, 402 — кончилась подписка или квота: ни то ни другое от повтора не исправится.
Only 429 and 503 are worth retrying. 401 means a bad key, 402 means the subscription or quota is out: neither is fixed by retrying.
Добавьте "stream": true — ответ пойдёт чанками SSE, как в OpenAI.
Add "stream": true and the answer arrives as SSE chunks, OpenAI-style.
curl -N https://api.ghostgpt.io/v1/chat/completions \
-H "Authorization: Bearer SK-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "ghostgpt",
"stream": true,
"messages": [{"role": "user", "content": "Write a short poem"}]
}'
data: [DONE] приходит чанк с блоком usage. Он присылается всегда: сервер сам ставит stream_options.include_usage, потому что по этому числу считается суточный потолок токенов. Если ваш клиент его не ждёт — просто игнорируйте.finish_reason: "length".finish_reason: "stop".data: [DONE] carries a usage block. It is sent always: the server sets stream_options.include_usage itself, because the daily token ceiling is counted from it. If your client does not expect it, just ignore it.finish_reason: "length".finish_reason: "stop".Формат OpenAI: base64 data-URI или ссылка.
OpenAI format: base64 data-URI or a URL.
{
"model": "ghostgpt",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "What is in this image?"},
{"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,..."}}
]
}]
}
413 request_too_large); base64 раздувает файл примерно на треть.413 request_too_large); base64 inflates a file by roughly a third.Шлюз не проксирует тело как есть. Перечислено всё, что он трогает, — остальное уходит в модель нетронутым.
The gateway does not pass the body through untouched. Everything it changes is listed below; the rest goes to the model as is.
| Поле | Что происходит |
|---|---|
model | Переписывается на текущую модель. |
messages[role=system], messages[role=developer] | Клиентский системный промпт отбрасывается — роль developer считается тем же system, — подставляется серверный. Личность и правила GhostGPT переопределить нельзя. |
max_tokens | Приводится к диапазону 32…16384. Нет поля, ноль, отрицательное или не целое — 16384. Меньше 32 — поднимается до 32. |
repeat_penalty, frequency_penalty, repeat_last_n | repeat_penalty и frequency_penalty поднимаются до нижней границы (1.12 / 0.25). repeat_last_n меньше 64 (или не целое) заменяется на 128; 64 и больше проходит как есть. Ниже — модель уходит в петлю и жжёт GPU впустую. |
grammar, grammar_type, grammar_lazy, grammar_triggers, json_schema | Удаляются. Грамматика — это способ повесить движок одним запросом. |
response_format | json_object и json_schema удаляются; ответ придёт текстом с кодом 200. Строгого JSON нет. |
logit_bias и родственные | Удаляются. |
stream_options.include_usage | Принудительно true для потоковых запросов. |
| Field | What happens |
|---|---|
model | Rewritten to the current model. |
messages[role=system], messages[role=developer] | Your system prompt is dropped — the developer role is treated as system — and the server’s one is injected. GhostGPT’s persona and rules cannot be overridden. |
max_tokens | Clamped to 32…16384. Missing, zero, negative or not an integer becomes 16384. Below 32 is raised to 32. |
repeat_penalty, frequency_penalty, repeat_last_n | repeat_penalty and frequency_penalty are raised to the floor (1.12 / 0.25). repeat_last_n below 64 (or not an integer) is replaced with 128; 64 and above passes unchanged. Below that the model loops and burns GPU for nothing. |
grammar, grammar_type, grammar_lazy, grammar_triggers, json_schema | Removed. A grammar is a way to hang the engine with a single request. |
response_format | json_object and json_schema are removed; you get plain text with status 200. There is no strict JSON mode. |
logit_bias and relatives | Removed. |
stream_options.include_usage | Forced to true for streaming requests. |
На выходе стоят три сторожа: утечка внутреннего промпта, вырожденный повтор и курсы валют, названные без данных с сайта. Каждый обрывает ответ — в потоке тоже.
Three output guards are in place: internal-prompt leakage, degenerate repetition, and FX rates quoted without web data. Each one cuts the answer short — in streaming mode as well.
| Что | Сколько | Что при превышении |
|---|---|---|
| Сообщений в сутки на аккаунт | 300 (оплачено) | 402 quota_exceeded |
| Из них ключу | 250 (на региональном тарифе — вся норма 50) | 402 api_quota_exceeded, в браузере ещё можно писать; на региональном тарифе — 402 quota_exceeded, пул выбран целиком |
| Выданных токенов в сутки | 150 000 | 402 token_quota_exceeded |
| Одновременных запросов | 1 на аккаунт | 429 concurrent_request, Retry-After: 5 |
| Запросов в минуту с адреса | 30, всплеск до 15 | 429 rate_limit |
| Размер тела | 32 МБ | 413 request_too_large |
| Одна генерация | 600 секунд | обрыв |
| What | How much | On excess |
|---|---|---|
| Messages per day per account | 300 (paid) | 402 quota_exceeded |
| Of those, for the key | 250 (regional plan — the whole 50) | 402 api_quota_exceeded, the browser still works; on the regional plan — 402 quota_exceeded, the whole pool is spent |
| Output tokens per day | 150,000 | 402 token_quota_exceeded |
| Concurrent requests | 1 per account | 429 concurrent_request, Retry-After: 5 |
| Requests per minute per IP | 30, burst 15 | 429 rate_limit |
| Body size | 32 MB | 413 request_too_large |
| Single generation | 600 seconds | cut off |
Счётчики обнуляются в 00:00 UTC. Точное время сброса приходит заголовком, гадать не нужно.
Counters reset at 00:00 UTC. The exact reset time comes back in a header, no guessing needed.
| Заголовок | Значение |
|---|---|
X-GhostGPT-Quota-Limit | Сколько сообщений в сутки доступно ключу |
X-GhostGPT-Quota-Remaining | Сколько осталось прямо сейчас |
X-GhostGPT-Quota-Reset | Unix-время обнуления счётчиков |
X-GhostGPT-Subscription-Until | Unix-время конца подписки |
X-GhostGPT-Key-Id | Публичный ярлык ключа |
Warning: 199 ghostgpt "…" | Подписка кончается меньше чем через 72 часа или уже кончилась |
X-Request-ID | Идентификатор запроса — назовите его в письме, и мы найдём вашу строку в журнале |
| Header | Meaning |
|---|---|
X-GhostGPT-Quota-Limit | Daily messages available to the key |
X-GhostGPT-Quota-Remaining | How many are left right now |
X-GhostGPT-Quota-Reset | Unix time when counters reset |
X-GhostGPT-Subscription-Until | Unix time when the subscription ends |
X-GhostGPT-Key-Id | Public label of the key |
Warning: 199 ghostgpt "…" | The subscription ends in under 72 hours, or has ended |
X-Request-ID | Request identifier — quote it in an email and we will find your log line |
Почему один запрос за раз. Модель обслуживает два запроса на весь сервис, и пул из десяти потоков занимает её целиком — веб-чат встаёт у всех, включая вас. Ограничитель не «сколько в минуту» (это делает отдельный лимит по адресу), а «сколько прямо сейчас».
Why one request at a time. The model serves two requests for the entire service, and a ten-thread pool takes it over completely — the web chat stalls for everyone, you included. This limiter is not about “per minute” (that is the separate per-IP limit) but about “right now”.
Квота занимается до обращения к модели и возвращается, если модель не ответила или поток лопнул, не отдав ни байта. Обрыв соединения вашей стороной возвратом не считается.
Quota is reserved before the model call and refunded if the model failed or the stream broke without a single byte. Your own disconnect is not a refund case.
Тело ошибки на /v1/* — JSON в формате OpenAI; на api.ghostgpt.io так отвечает и сам прокси (404, 413, 429), а на запасном ghostgpt.io/v1 ошибки прокси приходят его HTML-страницей. Вспомогательные ручки ghostgpt.io/api/* отвечают плоским {"error": "<code>"}.
Error bodies on /v1/* are JSON in the OpenAI format; on api.ghostgpt.io this includes the proxy’s own responses (404, 413, 429), while on the legacy ghostgpt.io/v1 proxy errors come as its HTML page. The auxiliary endpoints on ghostgpt.io/api/* reply with a flat {"error": "<code>"}.
{
"error": {
"message": "Human-readable explanation",
"type": "insufficient_quota",
"code": "subscription_required",
"request_id": "09ba82f5aa9ed61b"
}
}
| HTTP | code | Что случилось и что делать |
|---|---|---|
| 400 | invalid_request_body | Тело — не валидный JSON. Чаще всего большое вложение не догрузилось целиком: повторите или уменьшите файл. |
| 400 | context_length_exceeded | Диалог длиннее окна контекста модели. В теле tokens_requested и context_window, если движок сообщил числа. Начните новый диалог или уберите старые сообщения. |
| 401 | unauthorized | Заголовка Authorization нет вовсе. |
| 401 | invalid_api_key | Ключ не найден. Проверьте, что скопирован целиком, вместе с SK-. |
| 401 | revoked_api_key | Ключ отозван — вами или перевыпуском. Получите новый. |
| 401 | use_api_key | В Authorization лежит токен входа GG-…. Нужен ключ SK-…. |
| 402 | subscription_required | Подписка кончилась (и 72 часа тоже). В теле есть expired_at и plans_url. |
| 402 | quota_exceeded | Суточный пул аккаунта выбран. В теле reset_at. |
| 402 | api_quota_exceeded | Выбрана доля ключа (250). Веб-чат ещё работает. На региональном тарифе доля ключа равна всей норме (50), поэтому там вместо этого кода приходит quota_exceeded. |
| 402 | token_quota_exceeded | Кончился суточный бюджет выданных токенов. |
| 403 | account_blocked | Аккаунт заблокирован. Повторы не помогут — напишите нам. |
| 404 | unknown_endpoint | Такой ручки нет. Список — в разделе «Эндпоинты». |
| 413 | request_too_large | Тело больше 32 МБ. Уменьшите вложение или разбейте диалог. |
| 413 | payload_too_large | Тело больше 100 МБ — на api.ghostgpt.io его отрезает прокси ещё до шлюза, без request_id. Предел тот же — 32 МБ. |
| 429 | rate_limit | Слишком часто с одного адреса. Ждите Retry-After. |
| 429 | concurrent_request | У аккаунта уже идёт запрос. Дождитесь ответа, потом шлите следующий. |
| 500 | internal_error | Необработанная ошибка сервиса. Повторите запрос; если повторяется — пришлите X-Request-ID. |
| 503 | model_loading | Модель поднимается или перезапущена сторожем. Повторить через 5 секунд. |
| 503 | model_busy | Очередь к модели не рассосалась за 240 секунд ожидания. Сообщение из квоты не списано. Повторить через Retry-After (15 секунд). |
| 503 | capacity_exhausted | Сервис исчерпал суточную ёмкость для API. Повторить после 00:00 UTC. |
| HTTP | code | What happened and what to do |
|---|---|---|
| 400 | invalid_request_body | The body is not valid JSON. Usually a large attachment did not upload completely: retry or use a smaller file. |
| 400 | context_length_exceeded | The conversation is longer than the model’s context window. The body carries tokens_requested and context_window when the engine reported the numbers. Start a new chat or drop older messages. |
| 401 | unauthorized | No Authorization header at all. |
| 401 | invalid_api_key | Key not found. Check it was copied whole, including SK-. |
| 401 | revoked_api_key | The key was revoked — by you or by a rotation. Issue a new one. |
| 401 | use_api_key | Authorization carries a sign-in token GG-…. An SK-… key is required. |
| 402 | subscription_required | The subscription ended (and so did the 72-hour window). The body carries expired_at and plans_url. |
| 402 | quota_exceeded | The daily account pool is spent. The body carries reset_at. |
| 402 | api_quota_exceeded | The key’s share (250) is spent. The web chat still works. On the regional plan the key’s share equals the whole allowance (50), so you get quota_exceeded there instead. |
| 402 | token_quota_exceeded | The daily output-token budget is spent. |
| 403 | account_blocked | The account is blocked. Retrying will not help — contact us. |
| 404 | unknown_endpoint | No such endpoint. See the Endpoints section. |
| 413 | request_too_large | Body over 32 MB. Shrink the attachment or split the conversation. |
| 413 | payload_too_large | Body over 100 MB — on api.ghostgpt.io the proxy cuts it off before the gateway, with no request_id. The limit is still 32 MB. |
| 429 | rate_limit | Too frequent from one address. Wait for Retry-After. |
| 429 | concurrent_request | A request from this account is already running. Wait for it, then send the next one. |
| 500 | internal_error | Unhandled service error. Retry the request; if it persists, send us the X-Request-ID. |
| 503 | model_loading | The model is starting or was restarted by the watchdog. Retry in 5 seconds. |
| 503 | model_busy | The queue to the model did not clear within the 240-second wait. The message is not charged to your quota. Retry after Retry-After (15 seconds). |
| 503 | capacity_exhausted | The service ran out of daily API capacity. Retry after 00:00 UTC. |
Здесь честнее сказать сразу, чем оставить это на первый день интеграции.
Better said upfront than discovered on day one of your integration.
tools и tool_choice не вызывают ошибки, но и к вызовам не приводят — модель запущена без шаблонов инструментов.response_format и json_schema удаляются, ответ приходит текстом. Просите JSON словами и разбирайте с проверкой.system и developer отбрасываются; поведение задавайте первым сообщением от user./v1/embeddings, /v1/audio/*, /v1/images/* отвечают 404.tools and tool_choice do not raise errors, but they do not produce calls either — the model runs without tool templates.response_format and json_schema are stripped, answers come as text. Ask for JSON in words and parse defensively.system and developer roles are dropped; steer behaviour with the first user message./v1/embeddings, /v1/audio/*, /v1/images/* return 404.Это не часть OpenAI-совместимого /v1. Они живут на основном домене, принимают тот же ключ и требуют действующей оплаты. Квоту сообщений не тратят, но у каждой свой предел частоты.
These are not part of the OpenAI-compatible /v1. They live on the main domain, accept the same key and require an active subscription. They do not consume the message quota, but each has its own rate limit.
| Путь | Что делает | В минуту |
|---|---|---|
POST /api/fetch-url | Скачивает страницу и отдаёт текст (до 80 000 символов), заголовок, описание, иконку | 40 |
POST /api/web-research | Подбирает источники по вопросу: курсы валют, погода | 25 |
POST /api/pdf/extract | Текст из PDF (до 50 МБ, до 400 страниц) | 60 |
POST /api/transcribe | Распознавание речи (до 25 МБ и 30 минут звука, модель whisper base) | 8 |
POST /api/share | Публичная ссылка на диалог (до 2 МБ) | 30 |
GET /api/share/{id} | Снимок диалога — публично, без ключа | 30 |
| Path | What it does | Per minute |
|---|---|---|
POST /api/fetch-url | Fetches a page and returns text (up to 80,000 chars), title, description, favicon | 40 |
POST /api/web-research | Picks sources for a query: FX rates, weather | 25 |
POST /api/pdf/extract | Text from PDF (up to 50 MB, 400 pages) | 60 |
POST /api/transcribe | Speech recognition (up to 25 MB and 30 minutes of audio, whisper base) | 8 |
POST /api/share | Public link to a conversation (up to 2 MB) | 30 |
GET /api/share/{id} | Conversation snapshot — public, no key | 30 |
curl -X POST https://ghostgpt.io/api/fetch-url \
-H "Authorization: Bearer SK-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
Модель сама курсы валют не называет — сторож на выходе отклоняет такой ответ. Если вам нужны курсы, вызовите /api/web-research и вложите полученный текст в сообщение пользователя.
The model will not quote FX rates by itself — an output guard rejects such answers. If you need rates, call /api/web-research and paste the returned text into the user message.
User-Agent, ни Referer — только время, идентификатор запроса, метод, путь, код, объём и длительность.chat_id и язык для уведомлений об оплате. Если вы пришли по рекламной ссылке — метка кампании (первое касание) и записи переходов.POST ghostgpt.io/api/access/erase из вашей сессии (cookie входа; кнопки в интерфейсе пока нет). Удаляет счётчики, ключи, метку кампании, данные Telegram и связь с платежами; токен после этого мёртв. Сама строка платежа остаётся обезличенной — это бухгалтерия.User-Agent, no Referer — only time, request id, method, path, status, size and duration.chat_id and language for payment notifications. If you arrived through an ad link — the campaign label (first touch) and visit records.POST ghostgpt.io/api/access/erase from your session (sign-in cookie; there is no UI button yet). It removes counters, keys, the campaign label, Telegram data and the link to payments; the token is dead afterwards. The payment row itself stays, anonymised — that is accounting.Посмотрите code в теле ответа. api_quota_exceeded — выбрана доля ключа, сбросится в 00:00 UTC. quota_exceeded — выбран весь суточный пул аккаунта (на региональном тарифе приходит именно он). subscription_required — кончилась оплата. revoked_api_key — ключ перевыпущен, и где-то работает старая копия.
Check code in the response body. api_quota_exceeded — the key’s share is spent, resets at 00:00 UTC. quota_exceeded — the whole daily account pool is spent (on the regional plan this is the code you get). subscription_required — the subscription ended. revoked_api_key — the key was rotated and an old copy is still deployed somewhere.
Технически да, но квота одна на аккаунт, а одновременный запрос — один. Для двух независимых нагрузок дешевле два аккаунта, чем очередь из 429.
Technically yes, but the quota is per account and only one request runs at a time. For two independent workloads, two accounts are cheaper than a queue of 429s.
GET /v1/models. Она не тратит ничего и никогда не отвечает 402; заодно вернёт заголовки с остатком квоты и сроком подписки.
GET /v1/models. It costs nothing and never returns 402; it also brings back headers with the remaining quota and subscription end.
Если finish_reason: "length" — упёрлись в max_tokens или сработал сторож повторов. Если "stop" и текст короткий — сработал сторож на утечку промпта или на курсы валют без данных.
With finish_reason: "length" you hit max_tokens or the repetition guard. With "stop" and a short text, the prompt-leak or FX guard fired.
Да. Достаточно подменить base_url и api_key. Модель называйте ghostgpt — впрочем, любое имя всё равно будет переписано.
Yes. Just swap base_url and api_key. Use ghostgpt as the model name — although any name gets rewritten anyway.
72 часа она проживёт на бесплатном лимите и с заголовком Warning. За трое суток до конца подписки тот же заголовок приходит заранее — повесьте на него алерт, и сюрприза не будет.
It survives 72 hours on the free limit with a Warning header. The same header appears three days before expiry — hook an alert to it and there will be no surprise.
Через ghostgpt.io. Приложите X-Request-ID и key_id — этого хватит, чтобы найти вашу строку. Сам ключ присылать не нужно и не следует.
Via ghostgpt.io. Include X-Request-ID and key_id — that is enough to find your log line. Do not send the key itself.