MorphogenDocs

Quickstart

Key, base URL and the first request to a model in a few minutes.

The first request takes three steps: get a key, choose a model, send a request. The API is compatible with OpenAI and Anthropic, so their SDKs and any client with a configurable URL work.

Get a key

Open "API keys" in the console and click "Create key". A key like mg-… is shown in full once. Save it in an environment variable:

export MORPHOGEN_API_KEY=mg-...

More about key limits and access: Keys and access.

Choose a URL

SDKbase_url
OpenAIhttps://api.morphogen.ru/v1
Anthropichttps://api.morphogen.ru

Pass the key in the Authorization: Bearer <key> header. The x-api-key: <key> header is accepted too: the Anthropic SDK sends it.

Choose a model

The models available to your key:

curl https://api.morphogen.ru/v1/models \
  -H "Authorization: Bearer $MORPHOGEN_API_KEY"

Take names from the response, not from memory: the catalog changes.

Send a request

curl https://api.morphogen.ru/v1/chat/completions \
  -H "Authorization: Bearer $MORPHOGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 200,
    "messages": [{"role": "user", "content": "Привет"}]
  }'
Always pass max_tokens.

Without it, the request reserves an amount based on the model's maximum response length. With a small balance or key limit, the request may then return 402. In /v1/responses the field is called max_output_tokens.

For a streaming response, add "stream": true to the request body.

What you can call

All requests go to https://api.morphogen.ru with your key.

TaskRequest
Text, OpenAI Chat formatPOST /v1/chat/completions
Text, OpenAI Responses formatPOST /v1/responses
Text, Anthropic formatPOST /v1/messages
EmbeddingsPOST /v1/embeddings
Speech recognitionPOST /v1/audio/transcriptions
ImagesPOST /v1/images/generations
VideoPOST /v1/videos
Model listGET /v1/models

Any model of the "Text" or "Code" type accepts any of the three text formats.

If the request failed

Errors come in the OpenAI format: the code is in error.code. Common cases:

  • 401: the key is missing, invalid, revoked or expired.
  • 402 insufficient_funds: the balance does not cover the request reserve.
  • 403 model_not_allowed: the model is not in the key's list.
  • 429 rate_limit_exceeded: the key went over its per-minute request or token limit (120 and 200,000 by default). Retry after the time in the Retry-After header.

Full list: Errors.

Next

  • Connect Claude Code or Codex: Agents.
  • Give the documentation to an agent: every page has a markdown version. Add .md to the URL, for example /en/quickstart.md. Page index: llms.txt.

On this page