curl --request GET \
--url https://api.yourapp.com/api/ai/user-models \
--header 'Authorization: Bearer <token>'
const response = await fetch('https://api.yourapp.com/api/ai/user-models', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
});
const data = await response.json();
import requests
url = "https://api.yourapp.com/api/ai/user-models"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
data = response.json()
{
"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"
}
]
}
{
"success": false,
"message": "Unauthorized"
}
AI
Get User Models
Retrieves the current user’s configured AI models and credentials
GET
/
api
/
ai
/
user-models
curl --request GET \
--url https://api.yourapp.com/api/ai/user-models \
--header 'Authorization: Bearer <token>'
const response = await fetch('https://api.yourapp.com/api/ai/user-models', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
});
const data = await response.json();
import requests
url = "https://api.yourapp.com/api/ai/user-models"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
data = response.json()
{
"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"
}
]
}
{
"success": false,
"message": "Unauthorized"
}
Response
boolean
Indicates if the operation was successful
array
Array of user’s configured language models with credentials
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>'
const response = await fetch('https://api.yourapp.com/api/ai/user-models', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
});
const data = await response.json();
import requests
url = "https://api.yourapp.com/api/ai/user-models"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
data = response.json()
{
"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"
}
]
}
{
"success": false,
"message": "Unauthorized"
}
⌘I

