API reference / AI agents
Agent API
AI agents. Generated from the OpenAPI document the services export (/openapi.json).
Samples use the placeholders YOUR_API_KEY and YOUR_ACCOUNT_ID.
Paste a sandbox key (twsk_…) to fill them in and to use Try it.
It stays in this browser tab and is only sent to the sandbox, never to the live API.
Try it is off in this build: No sandbox URL is configured for this build of the docs.
GET /v1/agent/accounts
Agent Accounts Auth: X-Tickwire-Agent-Key
Accounts this key may use, by account id. Cursor-paginated:
{accounts, has_more, next_cursor}.
| Parameter | In | Type | Description |
|---|---|---|---|
limit | query | integer | Page size, 1..500 (default 100). |
cursor | query | string | null | The next_cursor of the previous page, unchanged. |
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/account-information
Agent Account Info Auth: X-Tickwire-Agent-Key
Balance, equity, margin… as reported by the broker (same shape as /users/current/…).
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string |
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/account-information' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/account-information",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/account-information");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/health
Agent Health Auth: X-Tickwire-Agent-Key
Truthful health with evidence (connected / disconnected / unknown).
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string |
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/health' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/health",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/health");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/history-deals
Agent Deals Auth: X-Tickwire-Agent-Key
Deals in a bounded window (default last 24 h, max 31 days).
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
start_time | query | string | null | |
end_time | query | string | null | |
limit | query | integer |
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/history-deals' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/history-deals",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/history-deals");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/orders
Agent Orders Auth: X-Tickwire-Agent-Key
Pending orders (same shape as /users/current/accounts/{id}/orders).
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string |
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/orders' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/orders",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/orders");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/positions
Agent Positions Auth: X-Tickwire-Agent-Key
Open positions (same shape as /users/current/accounts/{id}/positions).
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string |
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/positions' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/positions",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/positions");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/snapshot
Agent Snapshot Auth: X-Tickwire-Agent-Key
Account information, positions, orders, health and server time in one
read, with as_of and per-section freshness.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string |
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/snapshot' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/snapshot",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/snapshot");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/symbols/{symbol}/current-price
Agent Price Auth: X-Tickwire-Agent-Key
Current bid/ask with broker time.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
symbol required | path | string |
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-price' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-price",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-price");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/symbols/{symbol}/specification
Agent Spec Auth: X-Tickwire-Agent-Key
Symbol specification: volume limits and step, digits, contract size…
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
symbol required | path | string |
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/specification' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/specification",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/specification");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
POST /v1/agent/accounts/{account_id}/trade
Agent Trade Idempotency-Key Auth: X-Tickwire-Agent-Key
Place, modify, close or cancel a trade. Each trade is checked against the key's limits, the pre-trade hooks and the kill switches before it is sent, and is recorded in the audit trail.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
Idempotency-Key | header | string | null | |
X-Reason | header | string | null |
Request body any
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found409idempotency_conflict500, 502backend_error403kill_switch_engaged
curl
curl -sS -X POST 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/trade' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' \
-H 'Idempotency-Key: my-request-1' \
-H 'X-Reason: why you are doing this' \
-H 'Content-Type: application/json' \
-d '{"actionType":"ORDER_TYPE_BUY","symbol":"EURUSD","volume":0.01}' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"POST",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/trade",
json={"actionType": "ORDER_TYPE_BUY", "symbol": "EURUSD", "volume": 0.01},
idempotency_key="my-request-1",
reason="why you are doing this",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("POST", "/v1/agent/accounts/YOUR_ACCOUNT_ID/trade", {
body: {"actionType":"ORDER_TYPE_BUY","symbol":"EURUSD","volume":0.01},
idempotencyKey: "my-request-1",
reason: "why you are doing this",
});
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/audit
Agent Own Audit Auth: X-Tickwire-Agent-Key
This key's own audit entries, newest first. Cursor-paginated:
{entries, has_more, next_cursor}.
| Parameter | In | Type | Description |
|---|---|---|---|
limit | query | integer | Page size, 1..500 (default 50). |
before | query | integer | null | |
cursor | query | string | null | The next_cursor of the previous page, unchanged. |
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/audit' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/audit",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/audit");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/me
Agent Me Auth: X-Tickwire-Agent-Key
This key's permissions, kill switches and applicable hooks.
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/me' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/me",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/me");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/requests/{idempotency_key}
Agent Request Status Auth: X-Tickwire-Agent-Key
What happened to the trade sent with this idempotency key.
| Parameter | In | Type | Description |
|---|---|---|---|
idempotency_key required | path | string |
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/requests/IDEMPOTENCY_KEY' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/requests/IDEMPOTENCY_KEY",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/requests/IDEMPOTENCY_KEY");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.