Перейти к содержимому

Открытые модели. Один API.

Peryn API: четыре ведущие открытые модели, совместимые с OpenAI. Поменяйте базовый URL и ключ, а код оставьте как есть. Каждый запрос майнит, пока модель отвечает. Для компаний: обсудим с вами оплату по счёту и уровень Private.

Переход с OpenAI
2
строки меняются: базовый URL и ключ.
Модели
4
ведущие открытые модели, у каждой контекст в миллион токенов.
Хранимые промпты
0
промптов или ответов хранится. Мы никогда не обучаем на них модели.

Три шага до первого ответа.

  1. 01

    Get a key

    Sign in to the console and create a key. Add credit with USD stablecoins under Add credits.

  2. 02

    Set the base URL

    https://api.peryn.ai/v1

  3. 03

    Send a request

    Any OpenAI SDK. Streaming works the same way.

Тот же клиент, изменены 2 строки.

Python

2 lines changed

import osfrom openai import OpenAI client = OpenAI(Removed:     base_url="https://api.openai.com/v1",Removed:     api_key=os.environ["OPENAI_API_KEY"],Added:     base_url="https://api.peryn.ai/v1",Added:     api_key=os.environ["PERYN_API_KEY"],) reply = client.chat.completions.create(    model=MODEL,    messages=messages,)

JavaScript

2 lines changed

import OpenAI from "openai"; const client = new OpenAI({Removed:   baseURL: "https://api.openai.com/v1",Removed:   apiKey: process.env.OPENAI_API_KEY,Added:   baseURL: "https://api.peryn.ai/v1",Added:   apiKey: process.env.PERYN_API_KEY,}); const reply = await client.chat.completions.create({  model: MODEL,  messages,});

MODEL — один из идентификаторов моделей ниже, например deepseek-v4.1-flash-1017.

Четыре модели. Один API.

У каждой контекст в миллион токенов и своя страница: в чём модель сильнее всего, факты из её карточки, пример вызова.

Когда все GPU, обслуживающие модель, заняты, вы сразу получаете HTTP 429 с Retry-After. Когда её не обслуживает ни один, мы держим запрос до 4 минут, пока какой-нибудь не выйдет в сеть. Если этого не случится, вы получите HTTP 503 и ничего не заплатите.

Он майнит, пока отвечает.

Каждый запрос к Peryn API майнит $PEARL, пока его обслуживают: внутри ИИ-вычислений и в паузах между запросами. GPU зарабатывают дважды на одних и тех же вычислениях.

Большие задачи? Используйте Batch.

Отправьте много запросов одним файлом и укажите максимальную цену. GPU делают ставки, и задачу выполняет тот, чья ставка ниже всех.

Эндпоинты, которые вызывает ваш SDK.

Совместимо с OpenAI. Передавайте ключ как Bearer-токен.

https://api.peryn.ai/v1

  • POST/chat/completionsChat, streamed or in one piece.API key
  • POST/completionsText completion from a prompt.API key
  • GET/modelsEvery model: id, context, price.No key
  • GET/models/{id}One model.No key
  • GET/catalogPrices per 1M tokens and context, per model.No key

Стриминг как у OpenAI.

Задайте stream: true. Токены приходят как server-sent events, а поток заканчивается строкой data: [DONE].

import osfrom openai import OpenAI client = OpenAI(base_url="https://api.peryn.ai/v1",api_key=os.environ["PERYN_API_KEY"],) stream = client.chat.completions.create(model="deepseek-v4.1-flash-1017",messages=[{"role": "user", "content": "Hello"}],stream=True,)for chunk in stream:if chunk.choices:print(chunk.choices[0].delta.content or "", end="")

text/event-stream

: ping
data: {…,"choices":[{"index":0,"delta":{"role":"assistant","content":"Hel"}}]}
data: {…,"choices":[{"index":0,"delta":{"content":"lo."}}]}
data: {…,"choices":[],"usage":{"prompt_tokens":9,"completion_tokens":2,"total_tokens":11}}
data: [DONE]

Добавьте stream_options.include_usage, чтобы получить число токенов в последнем чанке. Строки, которые начинаются с двоеточия, держат соединение открытым; SDK OpenAI их пропускают.

Два уровня приватности.

У каждого API-ключа свой уровень, для одного разработчика или для всей компании. Ни один из них не хранит промпты и ответы, и мы никогда не обучаем на них модели.

Standard

Every key, by default. Standard runs on GPUs that also mine $PEARL, which keeps prices low. Your data never leaves the machine. Only a signed claim does, and for found blocks, a zero-knowledge proof that reveals nothing about the request.

Private

For companies with compliance needs. Never mined. Vetted nodes only, region rules, priced from GPU cost.

Talk to us about Private

Requests on our Private and Confidential tiers are never mined. Compute privacy

Set region rules, such as EU only, for your account or one key in the console. Every response a GPU served names its country in x-pc-node-country.

Предоплата. Понятные лимиты.

Вы платите за токены, которые использовал каждый запрос.

Prepaid credit

  • Held while a request runs: its input plus max_tokens, at the model’s price
  • Charged when it ends: the tokens it used
  • The rest of the hold goes back to your credit

Too little credit for the hold: 402. A lower max_tokens keeps holds small.

Limits per key

  • 60 requests per minute
  • 200,000 tokens per minute

The defaults. A request counts its prompt plus max_tokens, and gets back what it did not use. Over a limit: 429 with Retry-After.

Where you see them

Ошибки в формате OpenAI.

У каждой ошибки одно и то же JSON-тело. SDK OpenAI выбрасывают её вместе с кодом статуса.

Response

HTTP/1.1 402 Payment Required

{
"error": {
"message": "Not enough credit for this request. Lower max_tokens, or get more credit: see the console.",For people. Log it or show it.
"type": "insufficient_quota",The kind of error.
"param": null,The field at fault, when there is one.
"code": "insufficient_quota"Stable. Branch on it.
}
}
HTTP status codes, error codes and what to do
Status Code and what to do
400 invalid_jsonunsupported_parameter Fix the request. A retry gives the same answer.
401 missing_api_keyinvalid_api_keyrevoked_api_key Check the key in the Authorization header.
402 insufficient_quota Add credit in the console, or lower max_tokens.
404 model_not_found Use a model id from /models.
429 rate_limit_exceeded A rate limit is reached. Wait for Retry-After, then retry.
429 no_capacity Every GPU serving this model is busy. Wait for Retry-After, then retry.
503 no_capacityno_capacity_in_region No node serves this model right now, or none in your key’s regions. Wait for Retry-After, then retry.
504 timeout Retry, or lower max_tokens.

Headers worth logging

x-request-id
On every response. Quote it when you write to us.
Inference-Id
The same id as x-request-id, on every response. Your request’s tokens and cost are recorded under it.
retry-after
On 429 and 503: seconds to wait.
x-pc-node-country
The country of the GPU node that served the request.

Все коды полностью: документация API

Billing, credits and capacity.

How do I pay for the API?

The API is prepaid in US dollars, excluding VAT, and each request is charged against your credit. You add credit with USD stablecoins (USDC), sent to your account’s own deposit address under Add credits in the console. Credit is added one to one once the deposit is final. There is no card checkout. The free chat tokens need no credit.

Monthly invoices for businesses: talk to us

How is a request charged?

By tokens, counted with each model’s own tokenizer. When a request starts, we hold enough credit for its input plus its longest possible answer (max_tokens). When it ends, we charge what it used and release the rest. Without enough credit, the request is refused with HTTP 402.

Do credits expire?

Unused credits expire after 12 months without activity on your account. Activity means signing in, a request charged to your credits, or buying credits. We email you at least 30 days before.

Are there rate limits?

Each API key allows 60 requests and 200,000 tokens per minute by default, and the console shows each key’s limits. Over a limit you get HTTP 429 with a Retry-After header.

Need more? Talk to us

What happens when GPUs are busy?

Requests never queue behind busy GPUs. When every GPU serving a model is busy, you get HTTP 429 with a Retry-After header at once. When none is serving it, we hold the request for up to 4 minutes for one to come online. If none does, you get HTTP 503. A request that is not served costs nothing.

What happens to my prompts?

We do not log or store prompt or completion content, and never train on it. How mining affects your data:

Compute privacy
How a request is charged: the worst case is held, what it used is charged, the rest goes back.

Нужна другая открытая модель? Напишите нам.

We use your name, work email, company and message only to reply and to discuss working with you. We delete the stored enquiry 12 months after your last message, and keep our email thread with you for 2 years after our last reply. Privacy