一键导入
tossinvest-openapi-integration
Use when integrating Toss Securities Open API for market data, holdings, order workflows, and approval-gated execution.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when integrating Toss Securities Open API for market data, holdings, order workflows, and approval-gated execution.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | tossinvest-openapi-integration |
| description | Use when integrating Toss Securities Open API for market data, holdings, order workflows, and approval-gated execution. |
| version | 0.1.0 |
| author | kuil09 |
| license | MIT |
| metadata | {"hermes":{"tags":["tossinvest","openapi","trading","investing","brokerage"],"related_skills":["investment-monitoring-and-trade-briefs"]}} |
This skill packages agent-agnostic Toss Securities Open API guidance for Hermes. The same operational rules also work for other AI agents and automation systems. It covers authentication, account header requirements, read-only data access, approval-gated order flows, rate limits, and operational pitfalls such as IP allowlisting.
Use this skill when working on any Toss Securities Open API task, including:
https://openapi.tossinvest.com/openapi-docs/latest/openapi.jsonhttps://openapi.tossinvest.com/openapi-docs/overview.mdhttps://developers.tossinvest.com/docshttps://openapi.tossinvest.comAuthorization: Bearer {access_token}X-Tossinvest-Account: {accountSeq}tossinvest CLIRecommended companion CLI commands:
tossinvest — raw/programmatic API wrappertossinvest-snapshot — holdings + buying power + FX snapshot helpertossinvest-order-approval — Korean approval-packet generator for proposed live ordersUse it as the default programmable interface before hand-writing curl unless a task specifically requires raw HTTP.
Safe starter commands:
tossinvest env-check
tossinvest doctor
tossinvest token
tossinvest accounts
tossinvest holdings
tossinvest market prices --symbols 005930,AAPL
tossinvest market stocks --symbols 005930,AAPL
tossinvest market exchange-rate --base-currency KRW --quote-currency USD
tossinvest order-info buying-power --currency KRW
tossinvest-snapshot
tossinvest-order-approval --symbol 005930 --side BUY --order-type LIMIT --quantity 1 --price 350000
Order mutations are preview-only by default. The CLI only sends live create/modify/cancel requests when both flags are present:
tossinvest orders create ... --execute --confirm-live
tossinvest orders modify ... --execute --confirm-live
tossinvest orders cancel ... --execute --confirm-live
It supports:
~/.cache/tossinvest-openapi/token.json~/.zshrctossinvest raw ...tossinvest doctorPreferred env var names if you are wiring local scripts:
TOSSINVEST_API_KEYTOSSINVEST_SECRET_KEYMap them to the API's required token request fields:
client_id = TOSSINVEST_API_KEYclient_secret = TOSSINVEST_SECRET_KEYIf the user asks to store credentials in shell config, remember that protected credential files may reject direct file-edit tools. If so, use a safe file-writing path that still verifies the final file content.
If you build local wrappers around this API, prefer environment-variable injection over hardcoded secrets. Shell-config fallbacks are a convenience for local development, not a requirement for portable automation.
Request:
curl -s -X POST 'https://openapi.tossinvest.com/oauth2/token' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials' \
-d "client_id=$TOSSINVEST_API_KEY" \
-d "client_secret=$TOSSINVEST_SECRET_KEY"
Response fields to expect:
access_tokentoken_type = Bearerexpires_inCall:
curl -s 'https://openapi.tossinvest.com/api/v1/accounts' \
-H "Authorization: Bearer $ACCESS_TOKEN"
Use accountSeq from the response as the value for X-Tossinvest-Account.
X-Tossinvest-AccountSupports KR and US flows.
Fields commonly used:
clientOrderId (idempotency key)symbolside = BUY or SELLorderType = LIMIT or MARKETtimeInForce = commonly DAY or CLSquantityprice for limit ordersconfirmHighValueOrder when requiredOnly for US market buy flows and MARKET orders.
Common fields:
clientOrderIdsymbolsideorderType = MARKETorderAmountconfirmHighValueOrderUse the response headers to throttle dynamically:
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-ResetRetry-After on 429Important documented limits include:
AUTH: 5 TPSACCOUNT: 1 TPSASSET: 5 TPSSTOCK: 5 TPSMARKET_INFO: 3 TPSMARKET_DATA: 10 TPSMARKET_DATA_CHART: 5 TPSORDER: 6 TPS, but 09:00~09:10 KST is 3 TPSORDER_HISTORY: 5 TPSORDER_INFO: 6 TPS, but 09:00~09:10 KST is 3 TPSApply backoff and jitter on 429.
When auth fails, do not stop at "403". Inspect the error body and surface the operational next step.
Important case:
403 access_denied with error_description = IP address not allowedIn that case:
tossinvest doctor or equivalent token probe) after the allowlist change.For recurring automated investment workflows, prefer a stable egress IP (fixed-IP line, VPS, or other fixed outbound address) over a consumer dynamic-IP path.
Common important codes:
invalid-tokenexpired-tokenaccount-header-requiredaccount-not-foundinsufficient-buying-powerorder-hours-closedrequest-in-progressalready-filledalready-canceledalready-processingrate-limit-exceededPreserve requestId for support/debugging.
403 access_denied and IP address not allowed. In that case, whitelist the current public IP in Toss Securities WTS > Open API settings before retrying.orderId; the API can return a newly issued order identifier.status=OPEN|CLOSED query values as the same enum as orders[].status; the list filter is a grouped lifecycle label.llms.txt, overview markdown, or the canonical OpenAPI JSON instead of scraping rendered HTML.For implementation tasks, prefer producing:
X-Tossinvest-Account present for account-scoped endpointsreferences/tossinvest-openapi-summary.md — concise endpoint/auth/rate-limit notes captured from the official docs.references/local-cli-cookbook.md — local CLI usage examples, including snapshot and approval helper commands.