Trading Post (Exchange)

Config packs. One-click install. Clean uninstall.

Overview

Trading Post is a config pack marketplace. Packs bundle providers, modules, routes, workflows, templates, policies, and alerts into one installable unit.

Managing Packs

# List available packs
curl http://localhost:4200/api/exchange/packs

# Install a pack
curl -X POST http://localhost:4200/api/exchange/packs/safety-essentials/install

# View installed packs
curl http://localhost:4200/api/exchange/installed

# Uninstall
curl -X DELETE http://localhost:4200/api/exchange/installed/1
Starter packs
6 packs ship by default: Safety Essentials, Cost Control, OpenAI Quickstart, Anthropic Quickstart, Multi-Provider Failover, and Evaluation Suite.

Environments

# List environments
curl http://localhost:4200/api/exchange/environments

# Sync environment config
curl -X POST http://localhost:4200/api/exchange/environments/production/sync

See the Trading Post marketplace for the full pack catalog.

Config Packs

Packs are bundles of module configs, provider settings, routes, and policies. Install a pack to configure an entire workflow in one click:

curl http://localhost:4200/api/exchange/packs \
  -H "Authorization: Bearer sy_admin_..."
{
  "packs": [
    {"id": "pk_safety", "name": "safety-starter", "description": "Enable promptguard, toxicfilter, secretscan, agegate", "modules": 4},
    {"id": "pk_cost", "name": "cost-control", "description": "costcap + tierdrop + rateshield + usagepulse", "modules": 4},
    {"id": "pk_cache", "name": "caching-layer", "description": "cachelayer + embedcache + semanticcache", "modules": 3}
  ],
  "total": 3
}

Installing Packs

curl -X POST http://localhost:4200/api/exchange/packs/pk_safety/install \
  -H "Authorization: Bearer sy_admin_..."
{
  "installed": true,
  "pack": "safety-starter",
  "modules_enabled": ["promptguard", "toxicfilter", "secretscan", "agegate"],
  "applied_at": "2026-02-28T12:00:00Z"
}

Uninstalling Packs

curl -X POST http://localhost:4200/api/exchange/packs/pk_safety/uninstall \
  -H "Authorization: Bearer sy_admin_..."

Creating Custom Packs

Bundle your current module configuration into a shareable pack:

curl -X POST http://localhost:4200/api/exchange/packs \
  -H "Authorization: Bearer sy_admin_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-production-config",
    "description": "Full production setup with safety, caching, and cost controls",
    "modules": {
      "cachelayer": {"enabled": true, "config": {"ttl": 3600}},
      "costcap": {"enabled": true, "config": {"daily_limit_usd": 50}},
      "promptguard": {"enabled": true},
      "rateshield": {"enabled": true, "config": {"rpm": 120}}
    }
  }'

Pack Detail

curl http://localhost:4200/api/exchange/packs/pk_safety \
  -H "Authorization: Bearer sy_admin_..."

Trading Post Status

curl http://localhost:4200/api/exchange/status \
  -H "Authorization: Bearer sy_admin_..."
{
  "available_packs": 3,
  "installed_packs": 1,
  "last_sync": "2026-02-28T12:00:00Z"
}

Trading Post Configuration

# stockyard.yaml
apps:
  exchange:
    auto_sync: true
    sync_interval: 24h
    allow_community_packs: false
Environments: Use the Trading Post app to sync configurations between development, staging, and production instances. Export from one, import to another.

Config Sync Workflow

Sync configs between environments using export and import:

# 1. Export from development
curl http://dev.stockyard.internal/api/config/export \
  -H "Authorization: Bearer sy_admin_dev..." > config.json

# 2. Diff against production
curl -X POST http://prod.stockyard.internal/api/config/diff \
  -H "Authorization: Bearer sy_admin_prod..." \
  -d @config.json

# 3. Import to production (after review)
curl -X POST http://prod.stockyard.internal/api/config/import \
  -H "Authorization: Bearer sy_admin_prod..." \
  -d @config.json

Community Packs

Share your pack configurations with the community or keep them private to your organization. Packs can include:

ComponentWhat’s Included
Module configsEnable/disable flags and configuration
Brand policiesCompliance and content rules
Alert rulesThreshold alerts and webhook configs
Workflow definitionsForge DAG workflows

Tips

Version control: Export your config to a JSON file and commit it to Git alongside your application code. This gives you a full audit trail of configuration changes.
Automation: Use the Trading Post API in CI/CD pipelines to automatically sync configurations on deploy.

API Summary

MethodPathDescription
GET/api/exchange/statusTrading Post app status
GET/api/exchange/packsList available packs
POST/api/exchange/packsCreate custom pack
GET/api/exchange/packs/{id}Pack detail with module list
POST/api/exchange/packs/{id}/installInstall and apply pack
POST/api/exchange/packs/{id}/uninstallUninstall and revert

Pack Lifecycle

The typical lifecycle of a config pack:

PhaseAction
CreateBundle current config into a named pack
TestInstall on a staging instance and verify
SharePublish pack or export as JSON
InstallApply on production instances
UpdateCreate new version, reinstall
Rollback: Uninstalling a pack reverts all module configs to their state before the pack was installed. The previous state is stored as a snapshot.

Common Patterns

Use Trading Post packs for environment-specific configurations:

# Development: cache everything, low rate limits
dev-pack: cachelayer(on) + rateshield(rpm=10) + mockllm(on)

# Staging: full safety chain, moderate limits
staging-pack: promptguard(on) + toxicfilter(on) + rateshield(rpm=60)

# Production: safety + cost + monitoring
prod-pack: safety-starter + cost-control + alertpulse(on)

Import & Export

Packs can be exported as standalone JSON files for version control or sharing outside the API:

# Export a pack to a file
curl http://localhost:4200/api/exchange/packs/pk_safety \
  -H "Authorization: Bearer sy_admin_..." > safety-pack.json

# Import pack from file to another instance
curl -X POST http://localhost:4200/api/exchange/packs \
  -H "Authorization: Bearer sy_admin_..." \
  -H "Content-Type: application/json" \
  -d @safety-pack.json

This enables GitOps workflows where pack definitions live in version control alongside application code.

For the full Exchange API reference including all parameters and response schemas, see API Reference: Trading Post.

Trading Post pairs well with the Ops Guide Configuration for production deployment patterns.

Explore: Proxy-only mode · Self-hosted proxy · OpenAI-compatible