API Reference

Complete reference for all Forge API endpoints.

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

MethodEndpointDescription
POST/v1/chat/completionsCreate a chat completion (OpenAI-compatible)

Responses

MethodEndpointDescription
POST/v1/responsesCreate a response (Responses API format)

Features

MethodEndpointDescription
GET/v1/featuresList all available features
GET/v1/features/:userIdGet features for a user
POST/v1/features/:userId/:featureIdToggle a feature for a user

Admin

MethodEndpointDescription
GET/v1/admin/statusSystem status and metrics
GET/v1/admin/healthHealth check endpoint

Memory

MethodEndpointDescription
POST/v1/memory/searchSearch vector memory
GET/v1/memory/graph/:userId/entitiesGet graph entities
POST/v1/memory/storeStore a memory entry
DELETE/v1/memory/:userIdDelete user memory

Agents

MethodEndpointDescription
GET/v1/agentsList all agents
POST/v1/agentsCreate a new agent
GET/v1/agents/:idGet agent by ID
PUT/v1/agents/:idUpdate agent
DELETE/v1/agents/:idDelete agent

Connect

MethodEndpointDescription
GET/v1/connect/appsList available apps
GET/v1/connect/accountsList connected accounts
POST/v1/connect/actions/runExecute a connected action
GET/v1/connect/toolsList available tools
WS/v1/connect/eventsWebSocket 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"])