http://localhost:8000
All platform and service endpoints require authentication via API key:
-H "X-API-Key: ak_{key_id}_{secret}"Note: API keys must be manually seeded in the database currently.
Platform endpoints for managing test environments and runs.
GET /api/platform/healthReturns platform health status.
Response:
{
"status": "healthy",
"service": "diff-the-universe"
}GET /api/platform/testSuitesReturns all test suites.
Note: Test suites are currently read-only via API. Must be created directly in database.
Response:
[
{
"id": "suite-123",
"name": "Slack Agent Tests",
"tests": [...]
}
]GET /api/platform/testSuites/{suiteId}Returns a specific test suite with its tests.
Response:
{
"id": "suite-123",
"name": "Slack Agent Tests",
"tests": [
{
"id": "test-456",
"name": "Post message to channel",
"prompt": "Post 'Hello' to #general",
"expectedOutput": {...}
}
]
}POST /api/platform/initEnvCreates an isolated test environment with its own database schema.
Request Body:
{
"testId": "test-123",
"ttlSeconds": 1800,
"templateSchema": "slack_template",
"impersonateUserId": "U123",
"impersonateEmail": "agent@example.com"
}Parameters:
testId(string, required) - ID of the test definitionttlSeconds(number, optional) - Time-to-live in seconds (default: 1800)templateSchema(string, optional) - Template schema to clone fromimpersonateUserId(string, optional) - User ID to impersonate in servicesimpersonateEmail(string, optional) - Email to impersonate in services
Response:
{
"environmentId": "abc123",
"environmentUrl": "/api/env/abc123",
"expiresAt": "2025-10-12T20:00:00Z",
"schemaName": "state_abc123"
}POST /api/platform/startRunTakes a "before" snapshot of the environment state.
Request Body:
{
"testId": "test-123",
"testSuiteId": "suite-456",
"envId": "abc123"
}Response:
{
"runId": "run-789",
"status": "running",
"beforeSnapshot": "before_abc123_1234567890"
}POST /api/platform/endRunTakes an "after" snapshot, computes diff, evaluates assertions.
Request Body:
{
"runId": "run-789",
"envId": "abc123"
}Response:
{
"runId": "run-789",
"status": "completed",
"result": "pass",
"score": 1.0,
"diff": {
"inserts": [...],
"updates": [...],
"deletes": [...]
}
}GET /api/platform/results/{runId}Retrieves results for a completed test run.
Response:
{
"runId": "run-789",
"status": "completed",
"result": "pass",
"score": 1.0,
"failures": [],
"diff": {...}
}DELETE /api/platform/env/{envId}Cleans up an environment and its database schema.
Response:
{
"environmentId": "abc123",
"status": "deleted"
}Service endpoints mimic real service APIs but are isolated per environment.
Base path: /api/env/{envId}/services/slack
Implements Slack Web API methods:
POST /api/env/{envId}/services/slack/chat.postMessageRequest Body:
{
"channel": "C123456",
"text": "Hello from agent!",
"thread_ts": "1234567890.123456"
}GET /api/env/{envId}/services/slack/conversations.listQuery Parameters:
types- Comma-separated list (e.g., "public_channel,private_channel")limit- Number of results to return
GET /api/env/{envId}/services/slack/users.info?user=U123456See Slack Web API documentation for full method details.
Base path: /api/env/{envId}/services/linear
Status: In progress
Will implement Linear's GraphQL API at /api/env/{envId}/services/linear/graphql.
All endpoints return errors in this format:
{
"ok": false,
"error": "error_code",
"detail": "Human-readable error message"
}Common error codes:
not_authed- Missing or invalid API keyinvalid_environment_path- Malformed environment IDenvironment_not_found- Environment doesn't exist or expiredinternal_error- Server error