Introduction
API reference for authentication, tenant administration, users, plans, and LLM models.
This documentation aims to provide all the information you need to work with our API.
<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer Bearer {YOUR_JWT_TOKEN}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
Use the POST /api/auth/login endpoint to get a JWT access token, then send it as Authorization: Bearer {token}.
Authentication
User login.
Authenticate a user and return a JWT access token.
Example request:
curl --request POST \
"https://api.onegpt.ai.test/api/auth/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"admin@example.com\",
\"password\": \"secret1234\"
}"
const url = new URL(
"https://api.onegpt.ai.test/api/auth/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "admin@example.com",
"password": "secret1234"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9",
"token_type": "bearer",
"expires_in": 3600,
"user": {
"id": 1,
"email": "admin@example.com"
}
}
Example response (401):
{
"error": "Unauthorized"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Reset password.
Reset a user password using a valid password reset token.
Example request:
curl --request POST \
"https://api.onegpt.ai.test/api/auth/reset-password" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"token\": \"7fca298a-token\",
\"email\": \"user@example.com\",
\"password\": \"newPassword123\",
\"password_confirmation\": \"newPassword123\"
}"
const url = new URL(
"https://api.onegpt.ai.test/api/auth/reset-password"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"token": "7fca298a-token",
"email": "user@example.com",
"password": "newPassword123",
"password_confirmation": "newPassword123"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"message": "Your password has been reset!"
}
Example response (400):
{
"message": "This password reset token is invalid."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
User logout.
requires authentication
Invalidates the current JWT token.
Example request:
curl --request POST \
"https://api.onegpt.ai.test/api/auth/logout" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/auth/logout"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"message": "Successfully logged out"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Current authenticated user.
requires authentication
Returns authenticated user profile with roles and tenant.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/auth/me" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/auth/me"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"email": "admin@example.com",
"roles": [],
"tenant": null
}
Example response (401):
{
"error": "Not authenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Users
Export user statistics.
requires authentication
Exports user statistics as a downloadable file.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/users/export" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/users/export"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/users/export could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Sync users for all tenants.
requires authentication
Triggers full synchronization from the external source for all tenants.
Example request:
curl --request POST \
"https://api.onegpt.ai.test/api/users/sync-all" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/users/sync-all"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Sync users for one tenant.
requires authentication
Triggers synchronization for a specific tenant.
Example request:
curl --request POST \
"https://api.onegpt.ai.test/api/users/sync/1" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/users/sync/1"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Tenant list for filters.
requires authentication
Returns lightweight tenant list (id, name).
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/users/tenants-list" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/users/tenants-list"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/users/tenants-list could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List users.
requires authentication
Returns paginated users with optional filters.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/users?tenant_id=all&search=john&page=1&per_page=15" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/users"
);
const params = {
"tenant_id": "all",
"search": "john",
"page": "1",
"per_page": "15",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/users could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Service users stats.
requires authentication
Returns per-user usage breakdown for authenticated user's tenant.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/users/service-users" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/users/service-users"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/users/service-users could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
User model breakdown.
requires authentication
Returns model-level usage breakdown for one user in a tenant and date range.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/users/1/model-breakdown/user_123?start_date=2026-01-01&end_date=2026-01-31" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/users/1/model-breakdown/user_123"
);
const params = {
"start_date": "2026-01-01",
"end_date": "2026-01-31",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/users/1/model-breakdown/user_123 could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show user.
requires authentication
Returns a single user by ID.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/users/15" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/users/15"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/users/15 could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create user.
requires authentication
Creates a new user for the permitted tenant scope.
Example request:
curl --request POST \
"https://api.onegpt.ai.test/api/users" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/users"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update user.
requires authentication
Updates an existing user.
Example request:
curl --request PUT \
"https://api.onegpt.ai.test/api/users/15" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/users/15"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete user.
requires authentication
Deletes a user by ID.
Example request:
curl --request DELETE \
"https://api.onegpt.ai.test/api/users/15" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/users/15"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
User stats view.
requires authentication
Returns dashboard statistics for the authenticated user's tenant scope.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/users/stats/view" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/users/stats/view"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/users/stats/view could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
My usage stats.
requires authentication
Returns stats for the authenticated user.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/my-stats?start_date=2026-01-01&end_date=2026-01-31" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/my-stats"
);
const params = {
"start_date": "2026-01-01",
"end_date": "2026-01-31",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/my-stats could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Tenants
Global stats.
requires authentication
Return global statistics (super-admin) or tenant-specific equivalent.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/tenants/global-stats?start_date=2026-01-01&end_date=2026-01-31" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/tenants/global-stats"
);
const params = {
"start_date": "2026-01-01",
"end_date": "2026-01-31",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/tenants/global-stats could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Tenant detailed stats.
requires authentication
Get detailed usage/cost metrics for a tenant and optional date range.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/tenants/1/detailed-stats?start_date=2026-01-01&end_date=2026-01-31" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/tenants/1/detailed-stats"
);
const params = {
"start_date": "2026-01-01",
"end_date": "2026-01-31",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/tenants/1/detailed-stats could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Tenant subscriptions.
requires authentication
Returns subscription history for a tenant.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/tenants/1/subscriptions" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/tenants/1/subscriptions"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/tenants/1/subscriptions could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Add tenant subscription.
requires authentication
Creates a manual subscription entry for a tenant.
Example request:
curl --request POST \
"https://api.onegpt.ai.test/api/tenants/1/subscriptions" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/tenants/1/subscriptions"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List tenants.
requires authentication
Returns all tenants.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/tenants" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/tenants"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/tenants could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show tenant.
requires authentication
Returns a tenant with users.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/tenants/1" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/tenants/1"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
{
"message": "Tenant not found"
}
Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/tenants/1 could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create tenant.
requires authentication
Creates a new tenant.
Example request:
curl --request POST \
"https://api.onegpt.ai.test/api/tenants" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/tenants"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update tenant.
requires authentication
Updates an existing tenant.
Example request:
curl --request PUT \
"https://api.onegpt.ai.test/api/tenants/1" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/tenants/1"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete tenant.
requires authentication
Deletes a tenant by ID.
Example request:
curl --request DELETE \
"https://api.onegpt.ai.test/api/tenants/1" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/tenants/1"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Plans
List plans.
requires authentication
Returns all subscription plans.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/plans" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/plans"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/plans could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show plan.
requires authentication
Returns a specific plan.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/plans/1" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/plans/1"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/plans/1 could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create plan.
requires authentication
Creates a subscription plan.
Example request:
curl --request POST \
"https://api.onegpt.ai.test/api/plans" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/plans"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update plan.
requires authentication
Updates an existing plan.
Example request:
curl --request PUT \
"https://api.onegpt.ai.test/api/plans/1" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/plans/1"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete plan.
requires authentication
Deletes a plan.
Example request:
curl --request DELETE \
"https://api.onegpt.ai.test/api/plans/1" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/plans/1"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
LLM Models
List active LLM models.
requires authentication
Returns active LLM models with their current prices.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/llm-models" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/llm-models"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/llm-models could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Sync models from OpenRouter.
requires authentication
Runs the sync command and returns command output.
Example request:
curl --request POST \
"https://api.onegpt.ai.test/api/llm-models/sync" \
--header "Authorization: Bearer Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/llm-models/sync"
);
const headers = {
"Authorization": "Bearer Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Social Authentication
Redirect the user to the provider authentication page.
Redirects to OAuth provider login flow.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/auth/google/redirect" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/auth/google/redirect"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/auth/google/redirect could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Obtain the user information from provider.
Completes social login callback and redirects to frontend with token.
Example request:
curl --request GET \
--get "https://api.onegpt.ai.test/api/auth/google/callback" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api.onegpt.ai.test/api/auth/google/callback"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "The route api/auth/google/callback could not be found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.