Install Jentic One Beta
Jentic One is a self-hosted execution layer for AI agents. It lets your agent call the Capital.com Trading API, or any other public or private API you need. You set the rules, the agent never sees your credentials, and every call is logged.
Two steps, two machines. Install the instance in a safe environment, then register your agent from wherever it runs.
Step 1: Jentic One Host machine
# On the machine that will host your Jentic One instance:
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fcapital.com%2Fcapital" | shStep 2: Agent machine
# On the machine where your agent runs (keep this separate from the instance):
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fcapital.com%2Fcapital" | sh
jentic register # connects your agent to your Jentic One instanceJentic One is in public beta. The setup above keeps your agent separate from the instance, which is what you want before using real credentials: an agent running as the same OS user as Jentic One can read its stored keys directly. Just evaluating? A single local install is fine to start. See the secure deployment guide for the tiers.
What an agent can do with Capital.com Trading API.
Open a market or limit position on a specific epic with size, direction, and stop-loss
Place a working order at a target level and amend or cancel it before execution
Retrieve historical price candles for an instrument across configurable resolutions
Read account balance, transaction history, and activity logs for reconciliation
GET STARTED
Inspect client sentiment percentages on instruments to inform a strategy
Manage watchlists and add or remove epics to track instruments of interest
Patterns agents use Capital.com Trading API for, with concrete tasks.
★ Algorithmic CFD Execution
Quant strategies execute CFD trades programmatically via POST /api/v1/positions, supplying epic, direction, size, and stop/limit levels. The endpoint returns a dealReference that GET /api/v1/confirms/{dealReference} resolves to the final fill or rejection. The same flow handles demo and live accounts by switching the base URL.
POST /api/v1/positions with epic, direction=BUY, size, and stopLevel, then GET /api/v1/confirms/{dealReference} to confirm the fill.
Portfolio Snapshot Dashboard
A trader-facing dashboard pulls account state, open positions, and transaction history every minute to render P&L and margin utilisation. GET /api/v1/accounts, GET /api/v1/positions, and GET /api/v1/history/transactions provide the structured data, and the dashboard refreshes the session token before it expires using POST /api/v1/session.
Fetch GET /api/v1/accounts and GET /api/v1/positions every minute and render the combined balance and unrealised P&L.
Sentiment-Informed Strategy
Strategies that fade or follow retail sentiment poll GET /api/v1/clientSentiment/{epic} to read the long/short percentage on a given instrument. The signal feeds directly into a sizing rule before placing or scaling a position. Combined with price history from GET /api/v1/history/prices, this builds a self-contained signal pipeline against a single broker API.
GET /api/v1/clientSentiment/EURUSD and GET /api/v1/history/prices for the same epic, then size the next order based on the combined signal.
AI Agent Trading Assistant
An agent that tracks portfolio positions and executes user-approved trades uses Capital.com via Jentic. It searches for the open-position operation, loads the schema, and submits the trade once the user confirms. Session tokens stay encrypted in Jentic's vault and are refreshed automatically.
Search Jentic for 'open a Capital.com position', load the createPosition schema, and execute POST /api/v1/positions after the user confirms the size and direction.
36 endpoints — jentic publishes the only available openapi specification for capital.
METHOD
PATH
DESCRIPTION
/api/v1/session
Create a trading session and get CST and X-SECURITY-TOKEN headers
/api/v1/positions
Open a new position
/api/v1/workingorders
Place a working order
/api/v1/positions
List all open positions
/api/v1/history/prices
Retrieve historical price candles
/api/v1/clientSentiment/{epic}
Get client sentiment for an instrument
/api/v1/confirms/{dealReference}
Confirm the status of a deal
/api/v1/session
Create a trading session and get CST and X-SECURITY-TOKEN headers
/api/v1/positions
Open a new position
/api/v1/workingorders
Place a working order
/api/v1/positions
List all open positions
/api/v1/history/prices
Retrieve historical price candles
/api/v1/clientSentiment/{epic}
Get client sentiment for an instrument
/api/v1/confirms/{dealReference}
Confirm the status of a deal
What agents get from Jentic-routed access to this vendor.
Setup
Wiring the Capital.com Trading API by hand means creating a session from your X-CAP-API-KEY, tracking the derived CST and X-SECURITY-TOKEN headers, and choosing the live or demo host yourself. Through Jentic you install once, import Capital.com from the API Directory, store the key once, and your agent calls it.
Permission scoping
Capital.com carries its trade instructions in the request body rather than as a resource in the URL path, so limit the agent to the operations it needs, such as retrieving market data and price history. You choose the operations it may call, so opening positions or placing working orders is not included unless you add them.
Credential isolation
Your X-CAP-API-KEY and the session-derived CST and X-SECURITY-TOKEN headers are stored once, encrypted, by your own Jentic One instance, which refreshes the session and injects them at execution time. They never enter the agent's prompt, logs, or context.
Intent-based discovery
Agents search Jentic by intent such as 'retrieve Capital.com price history' or 'check client sentiment for an instrument', and Jentic returns the matching operation with its input schema so the agent calls the right endpoint without browsing the reference docs.
Alternatives and complements available in the Jentic catalogue.
Specific to using Capital.com Trading API through Jentic.
Why is there no official OpenAPI spec for Capital.com Trading API?
Capital.com publishes documentation but not an OpenAPI specification on its developer portal. Jentic generates and maintains this spec so that AI agents and developers can call Capital.com Trading API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.
What authentication does the Capital.com Trading API use?
It uses a three-header flow. POST /api/v1/session with the X-CAP-API-KEY header returns CST and X-SECURITY-TOKEN response headers; both must be sent on subsequent calls. Through Jentic the API key and session tokens are stored encrypted in the vault and rotated automatically.
Can I open a CFD position on a specific instrument with the Capital.com API?
Yes. POST /api/v1/positions with epic, direction, size, and optional stopLevel and limitLevel returns a dealReference. Resolve the final state by calling GET /api/v1/confirms/{dealReference}.
How do I retrieve historical price candles through Jentic?
Search Jentic for 'Capital.com price history', load the getPriceHistory operation, and execute GET /api/v1/history/prices with the epic, resolution, and date range. The response returns OHLC candles for the requested window.
What are the rate limits for the Capital.com Trading API?
Capital.com applies per-account rate limits that are not enumerated in the OpenAPI spec - its public docs cite 10 requests per second for general endpoints and tighter limits on session creation. Implement client-side backoff on 429 responses.
Can I use a demo account before going live?
Yes. The spec lists both servers: live (https://api-capital.backend-capital.com) and demo (https://demo-api-capital.backend-capital.com). Switch the base URL when instantiating the client to test against the demo environment first.
Can I limit what my agent is allowed to do with the Capital.com Trading API?
Yes. Because Jentic One is self-hosted, you decide which Capital.com operations your agent may call, and your own rules govern the credentials it uses. Since Capital.com carries its trade instructions in the request body rather than in the URL path, you can grant read-only access such as GET /api/v1/history/prices and GET /api/v1/clientSentiment/{epic} while withholding write operations like POST /api/v1/positions and POST /api/v1/workingorders. Those position and working-order calls stay unavailable to the agent unless you explicitly add them.
Know of an official OpenAPI document? Contribute it →
For Agents
Open and close trading positions, place working orders, and stream market data on Capital.com for CFDs and spread betting. Supports live and demo accounts via a session-based auth flow.
Use for: Open a long CFD position on EURUSD with a stop loss, Place a working order to buy GOLD at 2350, Retrieve the last 200 hourly candles for GBPJPY, Get the current account balance and available margin
Not supported: Does not handle KYC onboarding, payment processing, or tax reporting - use for session creation, market data, position and order management on Capital.com only.
Jentic publishes the only available OpenAPI specification for Capital.com Trading API, keeping it validated and agent-ready. The Capital.com Trading API exposes the full retail trading surface for CFDs and spread betting: session creation, account state, opening and closing positions, placing working orders, retrieving market metadata and price history, polling client sentiment, and managing watchlists. It supports both live and demo trading servers and uses a three-token auth flow (API key plus session-derived CST and X-SECURITY-TOKEN). Trading bots, portfolio dashboards, and algorithmic strategies use it as their execution and market-data feed.