Organizations, projects, and users
This section covers how to manage organizational structure and user accounts within OpenGateLLM.
Organization management
Organizations allow grouping users for organizational purposes.
Organization properties
name: Organization name (required)
Managing organizations
- Create organization
- Get organizations
- Get organization by ID
- Update organization
- Delete organization
curl -X POST http://localhost:8000/v1/admin/organizations \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{
"name": "My Organization"
}'
curl -X GET "http://localhost:8000/v1/admin/organizations?offset=0&limit=10&order_by=id&order_direction=asc" \
-H "Authorization: Bearer <api_key>"
curl -X GET http://localhost:8000/v1/admin/organizations/1 \
-H "Authorization: Bearer <api_key>"
curl -X PATCH http://localhost:8000/v1/admin/organizations/1 \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{
"name": "New Organization Name"
}'
curl -X DELETE http://localhost:8000/v1/admin/organizations/1 \
-H "Authorization: Bearer <api_key>"
Project management
Coming Soon
Project management functionality is currently under development and will be available in a future release.
Projects will allow you to:
- Group resources within an organization
- Isolate access and permissions at the project level
- Manage project-specific budgets and limits
User management
Users represent entities that can access the API. Each user must have an email, password, and assigned role.
User properties
email: User email address (required)name: User display name (optional)password: User password for authentication (required on creation)role: Role ID that determines permissions and limits (required)organization: Organization ID (optional)budget: Budget limit for the user (optional, see Budget)expires: Unix timestamp when the user account expires (optional)
info
Users also have sub and iss fields for OAuth2/ProConnect authentication. These are null when using email/password authentication.
Managing users
- Create user
- Get users
- Get user by ID
- Update user
- Delete user
curl -X POST http://localhost:8000/v1/admin/users \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{
"email": "john.doe@example.com",
"name": "John Doe",
"password": "secure_password",
"role": 1,
"organization": 1,
"budget": 100.0,
"expires": 1735689600
}'
curl -X GET "http://localhost:8000/v1/admin/users?role=1&organization=1&offset=0&limit=10&order_by=id&order_direction=asc" \
-H "Authorization: Bearer <api_key>"
curl -X GET http://localhost:8000/v1/admin/users/1 \
-H "Authorization: Bearer <api_key>"
curl -X PATCH http://localhost:8000/v1/admin/users/1 \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{
"email": "new.email@example.com",
"name": "John Smith",
"budget": 200.0
}'
curl -X DELETE http://localhost:8000/v1/admin/users/1 \
-H "Authorization: Bearer <api_key>"