DocumentationOverview

Learnya API

Models computed in Switzerland, behind the API your code already knows.

The Learnya API follows the OpenAI format. Keep your SDK, change the URL, the key and the model name. Every request is computed in Switzerland.

curl https://api.learnya.ai/v1/chat/completions \
  -H "Authorization: Bearer $LEARNYA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flash",
    "messages": [
      {
        "role": "user",
        "content": "Summarise Swiss data protection law."
      }
    ]
  }'
Response
{
  "id": "chatcmpl-5d0c9e2a41b7",
  "object": "chat.completion",
  "created": 1791633600,
  "model": "learnya-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "1. Personal data is processed lawfully, in good faith and for a stated purpose.\n2. Data protection is built in by design and by default.\n3. People can access their data and have it corrected or deleted."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 21, "completion_tokens": 52, "total_tokens": 73 }
}

Where to start

The path of a request

A request leaves your server, goes through our gateway and comes back with its response. In between, everything happens in Switzerland.

  1. On your side Your application Calls the API from your server, with your key. Stays Your key, which the API never sends back to you.
  2. In Switzerland api.learnya.ai Gateway Checks the key and picks the model your plan provides. Logs The workspace, the model and the token count. Never the content.
  3. Data centre Learnya model Computes the response. If a server does not respond, another one takes over in Switzerland. Never Your content is not used to train a model.
  4. Back Response Relayed as the model writes it, streamed if you ask. Stays On your side only. The gateway does not keep it.
The path of a request. The frame marks what runs in Switzerland.

What the API serves

EndpointForGuide
POST /v1/chat/completionsChat, streaming responses, reasoning and toolsChat
POST /v1/embeddingsVectors for semantic searchEmbeddings
POST /v1/assistantYour own assistants, their threads and their runsCreate your assistant
GET /.well-known/openid-configurationSign people in with their Learnya accountSign in with Learnya

Two models, called by name