Skip to main content
Weflayr has two APIs, authenticated by the same project API keys:

Authentication

Create a key in API keys, and send it as a Bearer token on every request:
A key belongs to one project and carries one or both scopes:
  • Gateway: calls models through the gateway. Each call is paid from your organization’s credits.
  • Management: everything else (the management API and the MCP server).

Project types

Some management routes only apply to one project type: Get margin answers a 400 on an internal project, and Get performance on a revenue-linked one.

Errors

The management API answers an error with its HTTP status and {"error": "<message>"}: 401 for a missing or invalid key, 422 for an invalid payload (with a detail list naming each field), 400 for a route that does not apply to the project’s type. The gateway answers in OpenAI’s error format, so OpenAI clients handle it as they would OpenAI’s:
When the provider refuses a request, the error also lists in weflayr_warnings the parameters the model does not take, as the likely cause.