Create a model configuration

Create a configuration. providerId is normalised to its family's representative provider (claude-code → anthropic). An organization may hold several configurations of one family or endpoint, for instance one provided by the organization and one by its members; a label left out is the provider's, numbered when another configuration already carries it. Permission: models:write.

POST/api/model-configs

Authorization

better-auth.session_token<token>

Cookie session from Better Auth. Requires X-Org-Id header for org-scoped routes.

In: cookie

Header Parameters

X-Org-Id?string

Organization ID. Required for cookie auth. Not needed for API key auth (org resolved from key).

Formatuuid

Request Body

application/json

curl -X POST "https://your-instance/api/model-configs" \  -H "Content-Type: application/json" \  -d '{    "providerId": "string"  }'
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "providerId": "string",
  "provider_name": "string",
  "label": "string",
  "base_url": "string",
  "provided_by": "organization",
  "accepts": [
    {
      "providerId": "string",
      "displayName": "string",
      "authMode": "api_key"
    }
  ],
  "org_connection": "active",
  "own_connection": "active",
  "personal_connection_count": 0,
  "pinned_agent_count": 0,
  "pinned_schedule_count": 0,
  "model_count": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}

{
  "type": "https://docs.appstrate.dev/errors/validation-failed",
  "title": "Validation Failed",
  "status": 400,
  "detail": "name: Invalid input: expected string, received undefined (+2 more)",
  "code": "validation_failed",
  "request_id": "req_abc123",
  "errors": [
    {
      "field": "name",
      "code": "required",
      "message": "Invalid input: expected string, received undefined"
    },
    {
      "field": "email",
      "code": "invalid_format",
      "message": "Invalid email address"
    },
    {
      "field": "age",
      "code": "invalid_type",
      "message": "Invalid input: expected number, received string"
    }
  ]
}

{
  "type": "https://docs.appstrate.dev/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Invalid or missing session",
  "code": "unauthorized",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "Insufficient permissions",
  "code": "forbidden",
  "request_id": "req_abc123"
}