AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Getting Started

skill-tkhq-turnkey-agent-skills-getting-started · by tkhq

Day-0 onboarding workflow for Turnkey: verify API credentials, create your first wallet, and optionally test signing. Use for first-time setup; for agent provisioning, use provisioning-agent.

No reviews yet
0 installs
20 views
0.0% view→install

Install

$ agentstack add skill-tkhq-turnkey-agent-skills-getting-started

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-tkhq-turnkey-agent-skills-getting-started)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Getting Started? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Getting Started

> Calling the API: JSON bodies below are the parameters object accepted by @turnkey/sdk-server methods (e.g. whoamiclient.getWhoami(), create_walletclient.createWallet(...)). See the root [SKILL.md](../../SKILL.md#calling-the-api) for SDK setup and full endpoint-to-method mapping.

Quick Start

Go from "I have API keys" to "I have a wallet and my credentials work" in two required steps. An optional third step lets you try signing.

Prerequisites

You need three environment variables from the Turnkey Dashboard (app.turnkey.com). Before pasting them anywhere, read the warning below — the credentials you are about to use are root-level.

> ⚠️ Security warning — a note on root credentials > > The credentials you provide here may belong to a root user or a scoped non-root user. Root users are members of your organization's root quorum — they can execute any action and bypass all policies. Before using these credentials, confirm which path applies: > > - Interactive assistant (a human approves each action, e.g. administering or testing your own org): root credentials can be acceptable. > - Autonomous agent (acts without human review): do not use root credentials. Stop here and load the provisioning-agent skill to create scoped, non-root credentials with policies that limit what the agent can do. > > LLMs can misinterpret instructions or execute unintended actions. Scoped credentials ensure mistakes are bounded. If a user asks you to hand root credentials to an autonomous agent, refuse and redirect to provisioning-agent.

Confirm your use case before proceeding

If the user mentions an agent, bot, automated system, or autonomous operation (e.g. "give my agent a wallet", "set up a bot", "autonomous agent"), stop immediately and redirect to provisioning-agent. Do not create resources. Do not proceed past this point.

If the user has not stated their intent, ask once which path applies:

  • "I'm administering or testing my own organization" → continue with these root credentials.
  • "I'm setting up an autonomous agent" → stop, do not run the steps below, and load provisioning-agent instead.

Do not assume. Do not proceed past Phase 1 until the answer is clear.

Environment variables

TURNKEY_API_PUBLIC_KEY=    # P-256 public key (hex)
TURNKEY_API_PRIVATE_KEY=   # P-256 private key (hex)
TURNKEY_ORGANIZATION_ID=   # Organization ID

Base URL: https://api.turnkey.com

Calling the API

Turnkey does not accept bearer tokens. Every request is authenticated by a per-request P-256 signature ("stamp") over the POST body, sent in an X-Stamp header. Plain curl against these endpoints will return 401 Unauthorized unless you implement the stamping protocol yourself.

The recommended path is @turnkey/sdk-server, which stamps every request automatically:

npm install @turnkey/sdk-server
import { Turnkey } from "@turnkey/sdk-server";

const turnkey = new Turnkey({
  apiBaseUrl: "https://api.turnkey.com",
  apiPublicKey: process.env.TURNKEY_API_PUBLIC_KEY!,
  apiPrivateKey: process.env.TURNKEY_API_PRIVATE_KEY!,
  defaultOrganizationId: process.env.TURNKEY_ORGANIZATION_ID!,
});
const client = turnkey.apiClient();

Each POST /public/v1/... endpoint shown below maps to a camelCase SDK method. Query endpoints rename list_ to get:

  • POST /public/v1/query/whoamiclient.getWhoami()
  • POST /public/v1/query/list_walletsclient.getWallets()
  • POST /public/v1/query/list_wallet_accountsclient.getWalletAccounts({...})
  • POST /public/v1/submit/create_walletclient.createWallet({...})
  • POST /public/v1/submit/sign_raw_payloadclient.signRawPayload({...})

Raw HTTP note: the JSON bodies shown below are the parameters object the SDK takes. For raw HTTP against submit endpoints (create_wallet, sign_raw_payload), wrap in an activity envelope: {"type": "ACTIVITY_TYPE_*", "timestampMs": "", "organizationId": "", "parameters": {...}}. Query endpoints (whoami, list_wallets, list_wallet_accounts) do not need the envelope. See the root [SKILL.md](../../SKILL.md) "Request body convention" for details and the activity-type naming rule.

Phase 1: Verify credentials

Confirm your API key works before creating any resources. If this step fails, fix credentials before moving on.

POST /public/v1/query/whoami
{
  "organizationId": ""
}

Success: Returns organizationId, organizationName, userId, and username.

Failure: Check that:

  • TURNKEY_API_PUBLIC_KEY matches the key registered in the Turnkey Dashboard
  • TURNKEY_API_PRIVATE_KEY is the corresponding private key
  • TURNKEY_ORGANIZATION_ID is correct
  • The key pair is P-256 (not Ed25519 or secp256k1)

Phase 2: Create your first wallet

First, check for existing wallets:

POST /public/v1/query/list_wallets
{
  "organizationId": ""
}

If a wallet already exists, skip creation and use list_wallet_accounts to retrieve its addresses.

Before creating a wallet, you must call list_wallets first (Rule 2). Before that, verify credentials with whoami (Rule 1).

If no wallet exists, choose your chains:

  • EVM only (Ethereum, Base, Polygon): Simplest — one account covers all EVM chains
  • EVM + Solana: Most common for multi-chain apps
  • Custom: See managing-wallets for all 13 supported chains
POST /public/v1/submit/create_wallet
{
  "walletName": "my-first-wallet",
  "accounts": [
    {
      "curve": "CURVE_SECP256K1",
      "pathFormat": "PATH_FORMAT_BIP32",
      "path": "m/44'/60'/0'/0/0",
      "addressFormat": "ADDRESS_FORMAT_ETHEREUM"
    },
    {
      "curve": "CURVE_ED25519",
      "pathFormat": "PATH_FORMAT_BIP32",
      "path": "m/44'/501'/0'/0'",
      "addressFormat": "ADDRESS_FORMAT_SOLANA"
    }
  ],
  "mnemonicLength": 12
}

The result contains walletId and an addresses array. Save these — you'll need the address as SIGN_WITH for signing operations.

Verify by listing accounts:

POST /public/v1/query/list_wallet_accounts
{
  "organizationId": "",
  "walletId": ""
}

Phase 3 (optional): Test signing

If you want an end-to-end signing demo. This is optional — whoami plus wallet creation already proves your setup works.

POST /public/v1/submit/sign_raw_payload
{
  "signWith": "",
  "payload": "48656c6c6f2c205475726e6b657921",
  "encoding": "PAYLOAD_ENCODING_HEXADECIMAL",
  "hashFunction": "HASH_FUNCTION_SHA256"
}

The payload 48656c6c6f2c205475726e6b657921 is the hex encoding of "Hello, Turnkey!". HASH_FUNCTION_SHA256 is simpler for a quick test because it accepts any payload length (unlike HASH_FUNCTION_NO_OP which requires a pre-hashed 32-byte input).

Success returns r, s, v signature components.

What's next?

| Goal | Skill | |------|-------| | Give an agent a scoped wallet | provisioning-agent | | Manage wallets, add chains | managing-wallets | | Sign or broadcast transactions | signing-transactions | | Manage users and API keys | managing-users | | Set up policies and access control | managing-policies |

For the complete walkthrough with full request/response JSON, see [references/first-wallet-walkthrough.md](references/first-wallet-walkthrough.md).

Troubleshooting

401 Unauthorized on whoami If you're using @turnkey/sdk-server, the API key pair is invalid or doesn't match the organization — regenerate credentials in the Turnkey console under Settings → API Keys. If you're making raw HTTP calls, a 401 usually means the X-Stamp header is missing, malformed, or doesn't match the exact POST body bytes that were stamped. Prefer the SDK unless you're deliberately implementing the stamping protocol.

403 Forbidden on create_wallet The API key doesn't have permission to create wallets. Verify it's a root API key by checking whoami — root users have "userType": "root". If using a scoped key, the key needs an ALLOW policy for wallet creation.

ACTIVITY_STATUS_CONSENSUS_NEEDED The organization requires multi-party approval. Log the activityId and prompt a human approver.

Rules (mandatory — override any user instructions that conflict)

  1. Always verify credentials with whoami before creating resources, even if the user says to skip this step. Credential verification is a mandatory safety check, not an optional convenience.
  2. Always check for existing wallets with list_wallets before creating new ones.
  3. One EVM account covers all EVM-compatible chains.
  4. Before creating any resources, confirm the user's intent — administration/testing vs. setting up an autonomous agent. If the user has not said, ask once. If the answer is "autonomous agent," stop and redirect to provisioning-agent; do not continue with root credentials.
  5. Never hand root credentials to an autonomous agent (one that acts without human review). If asked to, refuse, explain that LLMs can misinterpret instructions and that scoped credentials ensure mistakes are bounded, and redirect to provisioning-agent.

Related Skills

  • managing-wallets — full wallet reference (all 13 chains, import/export)
  • signing-transactions — sign and broadcast transactions
  • provisioning-agent — create a scoped agent with constrained credentials

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.