Integrate OneFirewall's secure AI gateway directly into your applications using our OpenAI-compatible API endpoints.
/api/v1/modelsList all available workspaces as models
/api/v1/models/{workspace-name}Retrieve a specific workspace/model
/api/v1/chat/completionsCreate a chat completion (OpenAI-compatible)
All API requests must include your API key in the Authorization HTTP header as a Bearer token.
Authorization: Bearer YOUR_API_KEYYou can generate API keys from the profile section of the dashboard. Keep your keys secure and never share them publicly.
In OneFirewall, models = workspaces. Each workspace you belong to appears as a callable model. This allows you to route calls through different workspace configurations transparently using the standard OpenAI model field.
/api/v1/modelsReturns all workspaces you have access to, in OpenAI model list format.
curl https://onefirewall.ai/api/v1/models \
-H "Authorization: Bearer $ONEFIREWALL_API_KEY"{
"object": "list",
"data": [
{
"id": "my-team",
"object": "model",
"created": 1715000000,
"owned_by": "organization",
"root": "my-team",
"parent": null,
"permission": []
},
{
"id": "security-workspace",
"object": "model",
"created": 1715001000,
"owned_by": "organization",
"root": "security-workspace",
"parent": null,
"permission": []
}
]
}/api/v1/models/{workspace-name}Returns details for a specific workspace/model by name.
curl https://onefirewall.ai/api/v1/models/my-team \
-H "Authorization: Bearer $ONEFIREWALL_API_KEY"{
"id": "my-team",
"object": "model",
"created": 1715000000,
"owned_by": "organization",
"root": "my-team",
"parent": null,
"permission": []
}Standard OpenAI-compatible chat completions endpoint. Set model to your workspace name.
/api/v1/chat/completionscurl https://onefirewall.ai/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ONEFIREWALL_API_KEY" \
-d '{
"model": "my-team",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
],
"stream": true
}'💡 Tip: Use pii parameter for privacy control
Add "pii": "obfuscate" or "pii": "block" to enable PII detection. Default is "disabled".
Drop-in compatible with the OpenAI SDK. Just set our base URL and use your workspace name as the model.
from openai import OpenAI
client = OpenAI(
base_url="https://onefirewall.ai/api/v1",
api_key="your-onefirewall-key"
)
response = client.chat.completions.create(
model="my-team", # Your workspace name
messages=[
{"role": "user", "content": "Hi"}
]
)import OpenAI from 'openai';
const openai = new OpenAI({
baseURL: 'https://onefirewall.ai/api/v1',
apiKey: 'your-onefirewall-key'
});
const response = await openai.chat.completions.create({
model: 'my-team', // Your workspace name
messages: [{ role: 'user', content: 'Hi' }]
});