Skip to main content
GET
/
api
/
ai
/
user-models
curl --request GET \
  --url https://api.yourapp.com/api/ai/user-models \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "ai_models": [
    {
      "id": "user_model_123",
      "modelId": "gpt-4o",
      "provider": "OpenAI",
      "apiKey": "sk-...xyz",
      "isDefault": true,
      "createdAt": "2024-01-15T10:30:00Z"
    },
    {
      "id": "user_model_456",
      "modelId": "claude-3-5-sonnet-20241022",
      "provider": "Anthropic",
      "apiKey": "sk-ant-...xyz",
      "isDefault": false,
      "createdAt": "2024-01-14T09:20:00Z"
    }
  ],
  "embeddings": [
    {
      "id": "user_embed_789",
      "modelId": "text-embedding-3-large",
      "provider": "OpenAI",
      "apiKey": "sk-...xyz",
      "isDefault": true,
      "createdAt": "2024-01-15T10:30:00Z"
    }
  ]
}

Response

success
boolean
Indicates if the operation was successful
ai_models
array
Array of user’s configured language models with credentials
embeddings
array
Array of user’s configured embedding models with credentials
curl --request GET \
  --url https://api.yourapp.com/api/ai/user-models \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "ai_models": [
    {
      "id": "user_model_123",
      "modelId": "gpt-4o",
      "provider": "OpenAI",
      "apiKey": "sk-...xyz",
      "isDefault": true,
      "createdAt": "2024-01-15T10:30:00Z"
    },
    {
      "id": "user_model_456",
      "modelId": "claude-3-5-sonnet-20241022",
      "provider": "Anthropic",
      "apiKey": "sk-ant-...xyz",
      "isDefault": false,
      "createdAt": "2024-01-14T09:20:00Z"
    }
  ],
  "embeddings": [
    {
      "id": "user_embed_789",
      "modelId": "text-embedding-3-large",
      "provider": "OpenAI",
      "apiKey": "sk-...xyz",
      "isDefault": true,
      "createdAt": "2024-01-15T10:30:00Z"
    }
  ]
}