API Reference
Optima Forge exposes a comprehensive REST API that is fully OpenAI-compatible with extended capabilities. All endpoints are available at https://api.optima-forge.com. Authentication is required via Bearer token in the Authorization header.
Base URL
https://api.optima-forge.com/v1
Chat
| Method | Endpoint | Description |
POST | /v1/chat/completions | Create a chat completion (OpenAI-compatible) |
Responses
| Method | Endpoint | Description |
POST | /v1/responses | Create a response (Responses API format) |
Features
| Method | Endpoint | Description |
GET | /v1/features | List all available features |
GET | /v1/features/:userId | Get features for a user |
POST | /v1/features/:userId/:featureId | Toggle a feature for a user |
Admin
| Method | Endpoint | Description |
GET | /v1/admin/status | System status and metrics |
GET | /v1/admin/health | Health check endpoint |
Memory
| Method | Endpoint | Description |
POST | /v1/memory/search | Search vector memory |
GET | /v1/memory/graph/:userId/entities | Get graph entities |
POST | /v1/memory/store | Store a memory entry |
DELETE | /v1/memory/:userId | Delete user memory |
Agents
| Method | Endpoint | Description |
GET | /v1/agents | List all agents |
POST | /v1/agents | Create a new agent |
GET | /v1/agents/:id | Get agent by ID |
PUT | /v1/agents/:id | Update agent |
DELETE | /v1/agents/:id | Delete agent |
Connect
| Method | Endpoint | Description |
GET | /v1/connect/apps | List available apps |
GET | /v1/connect/accounts | List connected accounts |
POST | /v1/connect/actions/run | Execute a connected action |
GET | /v1/connect/tools | List available tools |
WS | /v1/connect/events | WebSocket event stream |
Example: curl
curl -X POST https://api.optima-forge.com/v1/chat/completions \
-H "Authorization: Bearer $FORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"messages": [{"role": "user", "content": "Hello"}]
}'
Example: JavaScript
const response = await fetch("https://api.optima-forge.com/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.FORGE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "auto",
messages: [{ role: "user", content: "Hello" }],
}),
});
const data = await response.json();
console.log(data.choices[0].message.content);
Example: Python
import requests
response = requests.post(
"https://api.optima-forge.com/v1/chat/completions",
headers={"Authorization": f"Bearer {api_key}"},
json={
"model": "auto",
"messages": [{"role": "user", "content": "Hello"}],
},
)
print(response.json()["choices"][0]["message"]["content"])