# Place a Solana trade

Step 2 of a Solana buy or sale the user makes themselves. Starts the prepared trade from the agent's own Solana account: a USDC buy first moves its USDC to that account as SOL through 1Click, then swaps on Jupiter; a sale swaps, then sends its proceeds back to the agent wallet unless they stay as SOL. Send the prepared `trade`, the user's signature of its `authorization.message`, and its `requestKey` as the `Idempotency-Key` header. Returns the trade, its `status` `processing` while it runs, for up to nine minutes past the signature; follow it with Get a Solana trade until its status is final. One trade runs at a time per user. If this call times out, send it again unchanged: you get the same trade back, never a second one.

`POST /v1/users/{userId}/solana/trades`

## Authentication

Both headers are required.

- Header: `X-Api-Key: YOUR_API_KEY`
- Header: `Authorization: Bearer YOUR_USER_TOKEN` — A user's session token, from Create a session.

## Path parameters



```json
[
  {
    "schema": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
    },
    "in": "path",
    "name": "userId",
    "required": true,
    "description": "Your id for the user: the `userId` you sent to Create a user. It must be the session's user."
  }
]
```


## Header parameters



```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "example": "d5565100-9342-4bc6-a803-b387a20cb536",
    "in": "header",
    "name": "idempotency-key",
    "required": true,
    "description": "The prepared trade's `requestKey`, which the user's signature names. Send the same key and body again to retry safely: you get the same trade back, never a second one. A different body under the same key is refused with `request_key_conflict`."
  }
]
```


## Request body



```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/PlaceSolanaTradeInput"
      }
    }
  }
}
```


## Request example

Illustrative request. Replace the host, credentials and resource IDs with your own. If a request file is shown, create it from the schema above. Review the requested action before sending it.

```sh
curl --request POST 'https://api.example.test/v1/users/YOUR_USER_ID/solana/trades' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Authorization: Bearer YOUR_USER_TOKEN' \
  --header 'idempotency-key: d5565100-9342-4bc6-a803-b387a20cb536' \
  --header 'Content-Type: application/json' \
  --data-binary '@request.json'
```

## Responses

### 201

The trade, as Get a Solana trade returns it.



```json
{
  "description": "The trade, as Get a Solana trade returns it.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SolanaTrade"
      }
    }
  }
}
```


### 400

The request could not be read as this operation expects.

- `invalid_input` — the body or query failed validation; `issues` names each field
- `invalid_cursor` — the `cursor` is not one this list minted



```json
{
  "description": "The request could not be read as this operation expects.\n\n- `invalid_input` — the body or query failed validation; `issues` names each field\n- `invalid_cursor` — the `cursor` is not one this list minted",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 401

A credential is missing, invalid or expired.

- `partner_key_required` — no `X-Api-Key` header was sent
- `partner_key_invalid` — the `X-Api-Key` is unknown or revoked
- `credential_expired` — the user token has expired; obtain a fresh one



```json
{
  "description": "A credential is missing, invalid or expired.\n\n- `partner_key_required` — no `X-Api-Key` header was sent\n- `partner_key_invalid` — the `X-Api-Key` is unknown or revoked\n- `credential_expired` — the user token has expired; obtain a fresh one",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 403

The credentials are valid but may not do this.

- `subject_mismatch` — the `{userId}` in the path is not the token's user
- `account_disabled` — an operator disabled the account
- `origin_rejected` — a browser `Origin` other than the configured web origin
- `permission_required` — the verified credential is not permitted to make this call
- `solana_disabled` — Solana trading is not enabled for this user
- `solana_token_not_tradable` — Fin won't trade this token: its mint lets someone freeze, move or charge for holdings or pause transfers, it can't be sold back, Fin couldn't read its mint, it has no reliable price, or it is wrapped SOL. A sale is refused only for what would stop it landing
- `destination_not_allowed` — the user's wallet is an Agent API wallet, whose agent pays a deposit only to itself, to a NEAR Intents account its owner listed (on the confidential ledger) or to an address on a chain its owner listed; allow this one with Add a withdrawal destination (one owner signature), then ask again. A public NEAR Intents account, or an address with no valid spelling on its chain, cannot be paid at all; nothing was signed



```json
{
  "description": "The credentials are valid but may not do this.\n\n- `subject_mismatch` — the `{userId}` in the path is not the token's user\n- `account_disabled` — an operator disabled the account\n- `origin_rejected` — a browser `Origin` other than the configured web origin\n- `permission_required` — the verified credential is not permitted to make this call\n- `solana_disabled` — Solana trading is not enabled for this user\n- `solana_token_not_tradable` — Fin won't trade this token: its mint lets someone freeze, move or charge for holdings or pause transfers, it can't be sold back, Fin couldn't read its mint, it has no reliable price, or it is wrapped SOL. A sale is refused only for what would stop it landing\n- `destination_not_allowed` — the user's wallet is an Agent API wallet, whose agent pays a deposit only to itself, to a NEAR Intents account its owner listed (on the confidential ledger) or to an address on a chain its owner listed; allow this one with Add a withdrawal destination (one owner signature), then ask again. A public NEAR Intents account, or an address with no valid spelling on its chain, cannot be paid at all; nothing was signed",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 404

The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.

- `no_account` — the user has not opened the account this call reads; open it first



```json
{
  "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.\n\n- `no_account` — the user has not opened the account this call reads; open it first",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 409

The operation lost to the current state.

- `solana_trade_changed` — the Solana trade can no longer run as signed: the token's decimals or program changed, the agent's Solana account or holdings no longer fit it, another Solana trade is running, or the signature lapsed before it started. Nothing moved; prepare it again
- `agent_wallet_required` — create the agent wallet before opening a perps, prediction-market or Solana account
- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request



```json
{
  "description": "The operation lost to the current state.\n\n- `solana_trade_changed` — the Solana trade can no longer run as signed: the token's decimals or program changed, the agent's Solana account or holdings no longer fit it, another Solana trade is running, or the signature lapsed before it started. Nothing moved; prepare it again\n- `agent_wallet_required` — create the agent wallet before opening a perps, prediction-market or Solana account\n- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 413

The body exceeds the size this deployment accepts.



```json
{
  "description": "The body exceeds the size this deployment accepts.",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 429

A limit refused the request; wait for `Retry-After` when it is sent.

- `rate_limited` — the per-key or per-user limit is spent; honour `Retry-After`
- `partner_request_capacity` — this partner's request quota across all keys and replicas is spent; honour Retry-After



```json
{
  "description": "A limit refused the request; wait for `Retry-After` when it is sent.\n\n- `rate_limited` — the per-key or per-user limit is spent; honour `Retry-After`\n- `partner_request_capacity` — this partner's request quota across all keys and replicas is spent; honour Retry-After",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 500

A fault on our side; quote `requestId` when reporting it.

- `internal` — a fault on our side; quote `requestId` when reporting it



```json
{
  "description": "A fault on our side; quote `requestId` when reporting it.\n\n- `internal` — a fault on our side; quote `requestId` when reporting it",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 503

The service cannot take this right now (draining, a dependency did not answer, or an operator paused the work); `retryable` says whether to try again.

- `internal` — a fault on our side; quote `requestId` when reporting it
- `provider_unavailable` — an external provider the call depends on did not answer



```json
{
  "description": "The service cannot take this right now (draining, a dependency did not answer, or an operator paused the work); `retryable` says whether to try again.\n\n- `internal` — a fault on our side; quote `requestId` when reporting it\n- `provider_unavailable` — an external provider the call depends on did not answer",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


## Complete OpenAPI definition

The exact operation and all referenced components, including recursive schemas.



```json
{
  "operation": {
    "operationId": "solana.placeTrade",
    "summary": "Place a Solana trade",
    "tags": [
      "solana"
    ],
    "description": "Step 2 of a Solana buy or sale the user makes themselves. Starts the prepared trade from the agent's own Solana account: a USDC buy first moves its USDC to that account as SOL through 1Click, then swaps on Jupiter; a sale swaps, then sends its proceeds back to the agent wallet unless they stay as SOL. Send the prepared `trade`, the user's signature of its `authorization.message`, and its `requestKey` as the `Idempotency-Key` header. Returns the trade, its `status` `processing` while it runs, for up to nine minutes past the signature; follow it with Get a Solana trade until its status is final. One trade runs at a time per user. If this call times out, send it again unchanged: you get the same trade back, never a second one.",
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PlaceSolanaTradeInput"
          }
        }
      }
    },
    "parameters": [
      {
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
        },
        "in": "path",
        "name": "userId",
        "required": true,
        "description": "Your id for the user: the `userId` you sent to Create a user. It must be the session's user."
      },
      {
        "schema": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "example": "d5565100-9342-4bc6-a803-b387a20cb536",
        "in": "header",
        "name": "idempotency-key",
        "required": true,
        "description": "The prepared trade's `requestKey`, which the user's signature names. Send the same key and body again to retry safely: you get the same trade back, never a second one. A different body under the same key is refused with `request_key_conflict`."
      }
    ],
    "security": [
      {
        "apiKey": [],
        "userToken": []
      }
    ],
    "responses": {
      "201": {
        "description": "The trade, as Get a Solana trade returns it.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SolanaTrade"
            }
          }
        }
      },
      "400": {
        "$ref": "#/components/responses/InvalidInput"
      },
      "401": {
        "$ref": "#/components/responses/Unauthorized"
      },
      "403": {
        "description": "The credentials are valid but may not do this.\n\n- `subject_mismatch` — the `{userId}` in the path is not the token's user\n- `account_disabled` — an operator disabled the account\n- `origin_rejected` — a browser `Origin` other than the configured web origin\n- `permission_required` — the verified credential is not permitted to make this call\n- `solana_disabled` — Solana trading is not enabled for this user\n- `solana_token_not_tradable` — Fin won't trade this token: its mint lets someone freeze, move or charge for holdings or pause transfers, it can't be sold back, Fin couldn't read its mint, it has no reliable price, or it is wrapped SOL. A sale is refused only for what would stop it landing\n- `destination_not_allowed` — the user's wallet is an Agent API wallet, whose agent pays a deposit only to itself, to a NEAR Intents account its owner listed (on the confidential ledger) or to an address on a chain its owner listed; allow this one with Add a withdrawal destination (one owner signature), then ask again. A public NEAR Intents account, or an address with no valid spelling on its chain, cannot be paid at all; nothing was signed",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "404": {
        "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.\n\n- `no_account` — the user has not opened the account this call reads; open it first",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "409": {
        "description": "The operation lost to the current state.\n\n- `solana_trade_changed` — the Solana trade can no longer run as signed: the token's decimals or program changed, the agent's Solana account or holdings no longer fit it, another Solana trade is running, or the signature lapsed before it started. Nothing moved; prepare it again\n- `agent_wallet_required` — create the agent wallet before opening a perps, prediction-market or Solana account\n- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "413": {
        "$ref": "#/components/responses/PayloadTooLarge"
      },
      "429": {
        "$ref": "#/components/responses/TooManyRequests"
      },
      "500": {
        "$ref": "#/components/responses/Internal"
      },
      "503": {
        "description": "The service cannot take this right now (draining, a dependency did not answer, or an operator paused the work); `retryable` says whether to try again.\n\n- `internal` — a fault on our side; quote `requestId` when reporting it\n- `provider_unavailable` — an external provider the call depends on did not answer",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PlaceSolanaTradeInput": {
        "type": "object",
        "properties": {
          "trade": {
            "description": "The prepared trade, unchanged.",
            "$ref": "#/components/schemas/SolanaTradeRequestInput"
          },
          "authorization": {
            "type": "object",
            "properties": {
              "controllerId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                "description": "The `controllerId` returned with the message, unchanged: the wallet that signed."
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                "description": "The `expiresAt` returned with the message, unchanged, character for character."
              },
              "signature": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "evm",
                        "description": "An EIP-191 personal-message signature by the current controller."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte hexadecimal signature over the exact supplied message."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "webauthn",
                        "description": "A user-verified WebAuthn assertion over the message digest."
                      },
                      "credentialId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The signing credential identifier encoded as base64url."
                      },
                      "clientDataJSON": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's client-data JSON bytes encoded as base64url."
                      },
                      "authenticatorData": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator data bytes encoded as base64url."
                      },
                      "signature": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's signature encoded as base64url."
                      },
                      "userHandle": {
                        "description": "The optional authenticator user handle encoded as base64url.",
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 8192,
                            "pattern": "^[A-Za-z0-9_-]+$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "credentialId",
                      "clientDataJSON",
                      "authenticatorData",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "near",
                        "description": "A NEP-413 `signMessage` result over `{message, nonce, recipient}`, where `recipient` is the host of Fin's audience."
                      },
                      "publicKey": {
                        "type": "string",
                        "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                        "description": "The signing key as the wallet reports it (`ed25519:` then base58)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "nonce": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$",
                        "description": "The 32-byte nonce the caller gave the wallet, in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "publicKey",
                      "signature",
                      "nonce"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "solana",
                        "description": "A Solana `signMessage` Ed25519 signature over the exact UTF-8 message bytes."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "stellar",
                        "description": "A SEP-53 signature: Ed25519 over sha256(\"Stellar Signed Message:\\n\" + message)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "ton",
                        "description": "A TON Connect `signData` result for a `text` payload that is exactly the message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "address": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "description": "The signing wallet's address exactly as the wallet returned it."
                      },
                      "domain": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 253,
                        "description": "The dApp domain the wallet attested; it must be a partner-registered origin's host."
                      },
                      "timestamp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991,
                        "description": "The wallet's signing time in UNIX seconds; it must be within five minutes."
                      }
                    },
                    "required": [
                      "kind",
                      "signature",
                      "address",
                      "domain",
                      "timestamp"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "tron",
                        "description": "A TIP-191 `signMessageV2` signature over the exact message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte recoverable secp256k1 signature in hexadecimal."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  }
                ],
                "description": "The user's signature of the `message`, exactly as the API returned it."
              }
            },
            "required": [
              "controllerId",
              "expiresAt",
              "signature"
            ],
            "additionalProperties": false,
            "description": "The user's signature of the prepared trade's `authorization.message`, with its `controllerId` and `expiresAt` unchanged. Checked on arrival and never stored."
          }
        },
        "required": [
          "trade",
          "authorization"
        ],
        "additionalProperties": false
      },
      "SolanaTradeRequestInput": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "side": {
                "type": "string",
                "const": "buy",
                "description": "Buy the token."
              },
              "buy": {
                "description": "The exact buy: the token, what it pays, its all-in loss bound and its SOL top-up cap.",
                "$ref": "#/components/schemas/SolanaBuyInputInput"
              }
            },
            "required": [
              "side",
              "buy"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "side": {
                "type": "string",
                "const": "sell",
                "description": "Sell the token."
              },
              "sell": {
                "description": "The exact sale: the token, how much of it, where the proceeds go and its all-in loss bound.",
                "$ref": "#/components/schemas/SolanaSellInputInput"
              }
            },
            "required": [
              "side",
              "sell"
            ],
            "additionalProperties": false
          }
        ],
        "description": "A buy or a sale of one Solana token through the agent's own Solana account."
      },
      "SolanaBuyInputInput": {
        "type": "object",
        "properties": {
          "token": {
            "description": "The exact token to buy.",
            "$ref": "#/components/schemas/SolanaTokenInput"
          },
          "pay": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "usdc",
                    "description": "Pay from one USDC or USDT holding of the agent wallet (USDC on NEAR, Base, Arbitrum, Ethereum or Solana, or USDT on NEAR; any USDC that covers it before USDT), moved to Solana as SOL first."
                  },
                  "amountRaw": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "Exact USDC or USDT to spend, in six-decimal atomic units: $50 is \"50000000\". At least 5 (\"5000000\"); a smaller buy is refused."
                  }
                },
                "required": [
                  "kind",
                  "amountRaw"
                ],
                "additionalProperties": false,
                "description": "Spend an exact amount of USDC or USDT from the agent wallet."
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "sol",
                    "description": "Pay with SOL already in the agent's Solana account."
                  },
                  "lamports": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "Exact SOL to spend, in lamports (nine decimals): 0.5 SOL is \"500000000\"."
                  }
                },
                "required": [
                  "kind",
                  "lamports"
                ],
                "additionalProperties": false,
                "description": "Spend an exact amount of SOL the agent's Solana account already holds."
              }
            ],
            "description": "What the buy spends, as an exact input amount. Buying an exact number of tokens is not supported."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1500,
            "description": "Explicit all-in maximum value loss in basis points, from the value paid to the value received, fees and price impact included: at least 1, at most 1500. Required; no default."
          },
          "maxSolTopUpUsdcRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The most extra USDC or USDT the funding may add to keep SOL in the Solana account for network fees, in six-decimal atomic units: \"0\" for none, at most \"1000000\" (1 USDC). Must be \"0\" when paying with SOL."
          },
          "payWith": {
            "description": "A buy paid in dollars and approved in chat as one call: the coin its funding pays with instead of a USDC or USDT holding, and the most of it it may spend, the SOL top-up included. Never SOL. A buy from a token's page refuses it.",
            "$ref": "#/components/schemas/VenueFundingPaymentInput"
          }
        },
        "required": [
          "token",
          "pay",
          "maxValueLossBps",
          "maxSolTopUpUsdcRaw"
        ],
        "additionalProperties": false,
        "description": "One exact-input buy of a Solana token through the agent's own Solana account."
      },
      "SolanaTokenInput": {
        "type": "object",
        "properties": {
          "mint": {
            "type": "string",
            "minLength": 32,
            "maxLength": 44,
            "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
            "description": "The token's mint address, exactly as solana_token_search or solana_token returned it. Never a ticker."
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18,
            "description": "The mint's decimals, exactly as returned with the mint."
          },
          "tokenProgram": {
            "type": "string",
            "enum": [
              "spl_token",
              "token_2022"
            ],
            "description": "The program that owns the mint, exactly as returned with the mint: `spl_token` or `token_2022`."
          }
        },
        "required": [
          "mint",
          "decimals",
          "tokenProgram"
        ],
        "additionalProperties": false,
        "description": "One Solana token, pinned by its mint, its decimals and its token program."
      },
      "VenueFundingPaymentInput": {
        "type": "object",
        "properties": {
          "tokenId": {
            "type": "string",
            "maxLength": 256,
            "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
            "description": "The exact ledger asset identifier, including its token standard namespace."
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 38,
            "description": "How many decimal places the token's smallest unit represents."
          },
          "maxInputRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The most of the coin this funding may spend, in its smallest unit: the approved dollars at the price read when the approval opened, plus 5%."
          }
        },
        "required": [
          "tokenId",
          "decimals",
          "maxInputRaw"
        ],
        "additionalProperties": false,
        "description": "The coin this funding pays with and the most of it it may spend, as the owner approved them. Absent: the funding spends one USDC or USDT holding."
      },
      "SolanaSellInputInput": {
        "type": "object",
        "properties": {
          "token": {
            "description": "The exact token to sell.",
            "$ref": "#/components/schemas/SolanaTokenInput"
          },
          "amount": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "exact",
                    "description": "Sell an exact amount of the token."
                  },
                  "amountRaw": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "Exact amount of the token to sell, in its smallest unit (scaled by the token's decimals)."
                  }
                },
                "required": [
                  "kind",
                  "amountRaw"
                ],
                "additionalProperties": false,
                "description": "Sell an exact amount of the token."
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "fraction",
                    "description": "Sell a share of what the Solana account holds of the token."
                  },
                  "bps": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "description": "The share to sell, in basis points of the account's balance of the token: all of it is 10000, half is 5000."
                  }
                },
                "required": [
                  "kind",
                  "bps"
                ],
                "additionalProperties": false,
                "description": "Sell a share of the account's balance of the token."
              }
            ],
            "description": "How much of the token to sell."
          },
          "receive": {
            "type": "string",
            "enum": [
              "usdc",
              "sol"
            ],
            "description": "`usdc` returns the proceeds to the agent wallet as USDC on NEAR, which is what selling means; `sol` keeps them as SOL in the agent's Solana account."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1500,
            "description": "Explicit all-in maximum value loss in basis points, from the value paid to the value received, fees and price impact included: at least 1, at most 1500. Required; no default."
          }
        },
        "required": [
          "token",
          "amount",
          "receive",
          "maxValueLossBps"
        ],
        "additionalProperties": false,
        "description": "One sell of a Solana token held in the agent's own Solana account."
      },
      "SolanaTrade": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "The trade's id, for Get a Solana trade."
          },
          "requestKey": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "The `Idempotency-Key` it was placed under."
          },
          "trade": {
            "description": "The trade as the user signed it.",
            "$ref": "#/components/schemas/SolanaTradeRequest"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "partial",
              "refunded",
              "failed",
              "denied",
              "expired",
              "uncertain"
            ],
            "description": "`pending` until it starts, usually while it waits for the user's approval. `processing` while it runs, or while a Solana transaction it sent, or its transfer back to the agent wallet, has not finished. Then `completed` (the tokens bought, the proceeds of a sale or the SOL moved arrived), `partial` (part of it stands: a buy whose swap never happened after the account was funded, so the SOL is in the agent's Solana account, or a sale whose swap landed but whose transfer back did not finish, or that kept SOL, so the SOL is in the account or with 1Click until it refunds it; `solLeftLamports` says how much the account holds), `refunded` (1Click sent the funds back where they came from) or `failed` (nothing moved; `failureReason` says why). `denied` and `expired` mean the user denied it, or its approval ran out, before it started. `uncertain` means the result could not be confirmed yet: never ask the agent for a replacement, keep checking. `completed`, `partial`, `refunded`, `failed`, `denied` and `expired` are final."
          },
          "failureReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "insufficient_funds",
                  "quote_rejected",
                  "quote_expired",
                  "unavailable",
                  "not_authorized",
                  "stopped",
                  "not_executed",
                  "signing_disabled"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "When `status` is `failed`, why; otherwise `null`. `insufficient_funds`: the agent wallet or the Solana account did not hold enough, the account's reserve included. `quote_rejected`: the price or the route failed its checks, the loss limit would have been crossed, or a buy was under the minimum. `unavailable`: a temporary problem stopped it before anything was sent. `not_authorized`: the approval no longer covered it, or the token is one the agent does not trade. `stopped`: an operator paused trading or turned the wallet off. `not_executed`: nothing it sent landed before it expired. `signing_disabled`: this deployment does not sign trades. In every case nothing moved."
          },
          "stage": {
            "description": "The step it is on, once it started: `funding` moves USDC from the agent wallet to the Solana account as SOL through 1Click, `swap` trades on Jupiter, `sweep` sends a sale's SOL back to the agent wallet. A higher `revision` is newer.",
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1024,
                "description": "Persisted lifecycle stage number. Ignore an older snapshot for the same operation."
              },
              "phase": {
                "type": "string",
                "enum": [
                  "funding",
                  "swap",
                  "sweep"
                ]
              },
              "state": {
                "type": "string",
                "enum": [
                  "preparing",
                  "prepared",
                  "submitting",
                  "pending",
                  "delivering",
                  "confirmed",
                  "uncertain",
                  "refunded",
                  "failed",
                  "not_executed"
                ]
              },
              "transactionIndex": {
                "description": "The stored native transaction attempt, never a funding plan leg index.",
                "type": "integer",
                "minimum": 0,
                "maximum": 5
              }
            },
            "required": [
              "revision",
              "phase",
              "state"
            ]
          },
          "paid": {
            "description": "What the operation spent, once known.",
            "type": "object",
            "properties": {
              "asset": {
                "type": "string",
                "enum": [
                  "usdc",
                  "sol",
                  "token"
                ],
                "description": "`usdc` is the stablecoin a buy or fund paid (one USDC or USDT holding of the agent wallet, counted one raw unit for one) or the USDC on NEAR a sale or withdrawal returned, `sol` is SOL, `token` is the operation's own token."
              },
              "amountRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "The exact amount, in the asset's smallest unit."
              }
            },
            "required": [
              "asset",
              "amountRaw"
            ]
          },
          "received": {
            "description": "What the operation received, once it landed or settled.",
            "type": "object",
            "properties": {
              "asset": {
                "type": "string",
                "enum": [
                  "usdc",
                  "sol",
                  "token"
                ],
                "description": "`usdc` is the stablecoin a buy or fund paid (one USDC or USDT holding of the agent wallet, counted one raw unit for one) or the USDC on NEAR a sale or withdrawal returned, `sol` is SOL, `token` is the operation's own token."
              },
              "amountRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "The exact amount, in the asset's smallest unit."
              }
            },
            "required": [
              "asset",
              "amountRaw"
            ]
          },
          "solLeftLamports": {
            "description": "SOL the operation left in the Solana account, in lamports: what a partial outcome left behind.",
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$"
          },
          "transactions": {
            "maxItems": 6,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "purpose": {
                  "type": "string",
                  "enum": [
                    "swap",
                    "sweep"
                  ],
                  "description": "`swap` trades on Jupiter; `sweep` sends SOL back to the agent wallet through 1Click."
                },
                "signature": {
                  "type": "string",
                  "minLength": 64,
                  "maxLength": 88,
                  "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                  "description": "A Solana transaction signature, which is also its id: base58 text of 64 bytes."
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "signed",
                    "dispatching",
                    "landed",
                    "failed",
                    "expired",
                    "uncertain"
                  ],
                  "description": "`signed` and `dispatching` are not yet sent or not yet seen; `landed` succeeded on chain, `failed` landed with an error, `expired` provably never will; `uncertain` is not yet known: never sign it again."
                },
                "feeLamports": {
                  "description": "The network fee the transaction paid, in lamports, once it landed.",
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,38})$"
                }
              },
              "required": [
                "purpose",
                "signature",
                "state"
              ],
              "description": "One signed Solana transaction of this operation."
            },
            "description": "Every transaction the operation signed, in the order it signed them. A multi-coin sale lists here only its one transfer back: each coin's swaps are under its own entry of `sales`."
          },
          "completeBy": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "The latest it may still run, as the user signed it; its status is final by then."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was placed."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When its records last changed."
          }
        },
        "required": [
          "id",
          "requestKey",
          "trade",
          "status",
          "failureReason",
          "transactions",
          "completeBy",
          "createdAt",
          "updatedAt"
        ],
        "description": "A Solana buy or sale the user placed themselves: its status, the step it is on, and what it paid and received."
      },
      "SolanaTradeRequest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "side": {
                "type": "string",
                "const": "buy",
                "description": "Buy the token."
              },
              "buy": {
                "description": "The exact buy: the token, what it pays, its all-in loss bound and its SOL top-up cap.",
                "$ref": "#/components/schemas/SolanaBuyInput"
              }
            },
            "required": [
              "side",
              "buy"
            ]
          },
          {
            "type": "object",
            "properties": {
              "side": {
                "type": "string",
                "const": "sell",
                "description": "Sell the token."
              },
              "sell": {
                "description": "The exact sale: the token, how much of it, where the proceeds go and its all-in loss bound.",
                "$ref": "#/components/schemas/SolanaSellInput"
              }
            },
            "required": [
              "side",
              "sell"
            ]
          }
        ],
        "description": "A buy or a sale of one Solana token through the agent's own Solana account."
      },
      "SolanaBuyInput": {
        "type": "object",
        "properties": {
          "token": {
            "description": "The exact token to buy.",
            "$ref": "#/components/schemas/SolanaToken"
          },
          "pay": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "usdc",
                    "description": "Pay from one USDC or USDT holding of the agent wallet (USDC on NEAR, Base, Arbitrum, Ethereum or Solana, or USDT on NEAR; any USDC that covers it before USDT), moved to Solana as SOL first."
                  },
                  "amountRaw": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "Exact USDC or USDT to spend, in six-decimal atomic units: $50 is \"50000000\". At least 5 (\"5000000\"); a smaller buy is refused."
                  }
                },
                "required": [
                  "kind",
                  "amountRaw"
                ],
                "description": "Spend an exact amount of USDC or USDT from the agent wallet."
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "sol",
                    "description": "Pay with SOL already in the agent's Solana account."
                  },
                  "lamports": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "Exact SOL to spend, in lamports (nine decimals): 0.5 SOL is \"500000000\"."
                  }
                },
                "required": [
                  "kind",
                  "lamports"
                ],
                "description": "Spend an exact amount of SOL the agent's Solana account already holds."
              }
            ],
            "description": "What the buy spends, as an exact input amount. Buying an exact number of tokens is not supported."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1500,
            "description": "Explicit all-in maximum value loss in basis points, from the value paid to the value received, fees and price impact included: at least 1, at most 1500. Required; no default."
          },
          "maxSolTopUpUsdcRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The most extra USDC or USDT the funding may add to keep SOL in the Solana account for network fees, in six-decimal atomic units: \"0\" for none, at most \"1000000\" (1 USDC). Must be \"0\" when paying with SOL."
          },
          "payWith": {
            "description": "A buy paid in dollars and approved in chat as one call: the coin its funding pays with instead of a USDC or USDT holding, and the most of it it may spend, the SOL top-up included. Never SOL. A buy from a token's page refuses it.",
            "$ref": "#/components/schemas/VenueFundingPayment"
          }
        },
        "required": [
          "token",
          "pay",
          "maxValueLossBps",
          "maxSolTopUpUsdcRaw"
        ],
        "description": "One exact-input buy of a Solana token through the agent's own Solana account."
      },
      "SolanaToken": {
        "type": "object",
        "properties": {
          "mint": {
            "type": "string",
            "minLength": 32,
            "maxLength": 44,
            "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
            "description": "The token's mint address, exactly as solana_token_search or solana_token returned it. Never a ticker."
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18,
            "description": "The mint's decimals, exactly as returned with the mint."
          },
          "tokenProgram": {
            "type": "string",
            "enum": [
              "spl_token",
              "token_2022"
            ],
            "description": "The program that owns the mint, exactly as returned with the mint: `spl_token` or `token_2022`."
          }
        },
        "required": [
          "mint",
          "decimals",
          "tokenProgram"
        ],
        "description": "One Solana token, pinned by its mint, its decimals and its token program."
      },
      "VenueFundingPayment": {
        "type": "object",
        "properties": {
          "tokenId": {
            "type": "string",
            "maxLength": 256,
            "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
            "description": "The exact ledger asset identifier, including its token standard namespace."
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 38,
            "description": "How many decimal places the token's smallest unit represents."
          },
          "maxInputRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The most of the coin this funding may spend, in its smallest unit: the approved dollars at the price read when the approval opened, plus 5%."
          }
        },
        "required": [
          "tokenId",
          "decimals",
          "maxInputRaw"
        ],
        "description": "The coin this funding pays with and the most of it it may spend, as the owner approved them. Absent: the funding spends one USDC or USDT holding."
      },
      "SolanaSellInput": {
        "type": "object",
        "properties": {
          "token": {
            "description": "The exact token to sell.",
            "$ref": "#/components/schemas/SolanaToken"
          },
          "amount": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "exact",
                    "description": "Sell an exact amount of the token."
                  },
                  "amountRaw": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "Exact amount of the token to sell, in its smallest unit (scaled by the token's decimals)."
                  }
                },
                "required": [
                  "kind",
                  "amountRaw"
                ],
                "description": "Sell an exact amount of the token."
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "fraction",
                    "description": "Sell a share of what the Solana account holds of the token."
                  },
                  "bps": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "description": "The share to sell, in basis points of the account's balance of the token: all of it is 10000, half is 5000."
                  }
                },
                "required": [
                  "kind",
                  "bps"
                ],
                "description": "Sell a share of the account's balance of the token."
              }
            ],
            "description": "How much of the token to sell."
          },
          "receive": {
            "type": "string",
            "enum": [
              "usdc",
              "sol"
            ],
            "description": "`usdc` returns the proceeds to the agent wallet as USDC on NEAR, which is what selling means; `sol` keeps them as SOL in the agent's Solana account."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1500,
            "description": "Explicit all-in maximum value loss in basis points, from the value paid to the value received, fees and price impact included: at least 1, at most 1500. Required; no default."
          }
        },
        "required": [
          "token",
          "amount",
          "receive",
          "maxValueLossBps"
        ],
        "description": "One sell of a Solana token held in the agent's own Solana account."
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The kind of problem as a URN, `urn:fin:error:<kind>`; stable, compare against it"
          },
          "title": {
            "type": "string",
            "description": "The kind's human title, for logs; never parse it"
          },
          "status": {
            "type": "integer",
            "minimum": 400,
            "maximum": 599,
            "description": "The HTTP status, repeated in the body"
          },
          "reason": {
            "description": "The machine-readable why. One of:\n\n- `run_active` (409) — a run already holds this conversation\n- `budget_exhausted` (429) — the user's AI usage budget, or your partner account's AI spend limit, is used up until the next day or month, or an operator froze it\n- `approval_not_pending` (409) — the approval was already decided or has expired, or its id does not exist or belongs to a different conversation\n- `execution_capacity` (429) — no capacity is free to run this right now; honour `Retry-After`\n- `execution_unavailable` (503) — the service that runs the agent could not take the work; `retryable` says whether to try again\n- `stop_pending` (409) — a stop is already in progress and its cleanup is not yet confirmed\n- `automation_changed` (409) — the automation changed while this request was handled; read it again and retry\n- `automation_held` (409) — an operator holds the automation; it fires again when released\n- `automation_invalid` (409) — the automation's definition cannot run as written\n- `automation_paused` (409) — the automation is paused; resume it first\n- `automation_has_no_webhook` (409) — the automation does not run on incoming events, so it has no webhook\n- `automation_limit` (409) — the user already has as many automations as the deployment allows\n- `profile_unknown_tool` (400) — `profile.tools` names a tool this deployment does not have\n- `deployment_paused` (503) — an operator paused this kind of work for the deployment; try again later\n- `run_not_active` (409) — the run named in the path is not the conversation's live run\n- `withdrawal_changed` (409) — the request key already binds different withdrawal terms, or the current balance cannot cover the requested amount\n- `swap_changed` (409) — the swap cannot be made as asked: an asset is no longer available or the current balance cannot cover the amount; get a new quote\n- `order_changed` (409) — the order can no longer be placed as prepared: the agent wallet no longer holds the amount, an asset is no longer offered, or its minimum no longer matches the assets' precision; prepare it again\n- `prediction_order_changed` (409) — the Polymarket order can no longer be placed as signed: the market closed or stopped taking orders, its price is off the market's tick or its size off Polymarket's minimum, its fee or cost would exceed the signed caps, the Polymarket account cannot cover it, or the signature lapsed before it was placed. Nothing was placed; prepare it again\n- `solana_trade_changed` (409) — the Solana trade can no longer run as signed: the token's decimals or program changed, the agent's Solana account or holdings no longer fit it, another Solana trade is running, or the signature lapsed before it started. Nothing moved; prepare it again\n- `trade_not_recoverable` (409) — the original trade or a recovery attempt remains active or uncertain, its unfinished actions lack conclusive recovery proof, or its remaining proposal can no longer be used\n- `order_not_cancelable` (409) — the limit order can no longer be cancelled: it filled or expired, or the swap provider never took it. Read the order for where it stands\n- `grid_not_active` (409) — the grid is not running, so it cannot be paused: it is already paused, stopping or ended. Read the grid for where it stands\n- `grid_not_paused` (409) — the grid is not paused, so there is nothing to resume. Read the grid for where it stands\n- `suggestion_changed` (409) — the suggestion no longer holds: the account or the market moved since fin made it, the user set it aside, or it cannot be made where the user is now. Say it changed, and read the page's suggestions again\n- `request_key_conflict` (409) — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request\n- `question_not_pending` (409) — the questionnaire has already been answered, closed, or is not awaiting this submission\n- `flag_changed` (409) — the flag's targeting changed since you read it; read it again and retry\n- `group_changed` (409) — the group changed or was deleted since you read it; read it again and retry\n- `group_in_use` (409) — a flag's rules still name this group; take it out of those rules first\n- `group_name_taken` (409) — another group already has this name\n- `agent_wallet_required` (409) — create the agent wallet before opening a perps, prediction-market or Solana account\n- `wallet_account_unsupported` (409) — the user's wallet is an Agent API wallet, whose Intents account is a 0x address this route cannot name; read it with Get wallet account, Get wallet account balances and Open a wallet account session instead\n- `conversation_deleted` (410) — the conversation was deleted; its history stays readable\n- `automation_deleted` (410) — the automation was deleted\n- `grid_ended` (410) — the grid stopped, expired or failed; it stays readable but takes no command. A new grid needs the user's approval in chat\n- `credential_expired` (401) — the user token has expired; obtain a fresh one\n- `account_disabled` (403) — an operator disabled the account\n- `perps_disabled` (403) — perps is not enabled for this user\n- `prediction_disabled` (403) — prediction-market trading is not enabled for this user\n- `solana_disabled` (403) — Solana trading is not enabled for this user\n- `no_account` (404) — the user has not opened the account this call reads; open it first\n- `not_available_in_region` (403) — perps funding is unavailable in the user's region for this request; withdrawals remain available\n- `steering_disabled` (403) — steering a working run is not turned on for this user; send the message with Start a run once the run ends\n- `baskets_disabled` (403) — idea baskets are not turned on for this user; hide the Ideas pages and their baskets\n- `basket_buying` (409) — the basket is still buying, so it cannot be deleted yet; try again once its result is in\n- `basket_awaiting_approval` (409) — an approval to buy this basket is still open; decline it in the chat, then delete the basket\n- `basket_step_not_failed` (409) — the step bought, or the basket is not partly bought, so no order can be linked to it; read the basket again\n- `basket_step_linked` (409) — another order is already linked to this step; a link is permanent, so read the basket again\n- `basket_order_not_linkable` (400) — the order cannot stand in for this step: it is not one of the step's `failures[].linkable` orders, or another basket step already holds it\n- `voice_disabled` (403) — voice input is not turned on for this user; let them type instead\n- `voice_unavailable` (503) — this deployment has no speech model, so it cannot transcribe recordings; let the user type instead\n- `provider_unavailable` (503) — an external provider the call depends on did not answer\n- `quote_refused` (400) — 1Click would not quote this request, usually an amount below what it routes or a pair it does not offer; nothing was reserved. Change the amount or the assets and quote again; for a deposit address, no address was issued, so offer another network\n- `invalid_input` (400) — the body or query failed validation; `issues` names each field\n- `internal` (500) — a fault on our side; quote `requestId` when reporting it\n- `partner_key_required` (401) — no `X-Api-Key` header was sent\n- `partner_key_invalid` (401) — the `X-Api-Key` is unknown or revoked\n- `subject_mismatch` (403) — the `{userId}` in the path is not the token's user\n- `origin_rejected` (403) — a browser `Origin` other than the configured web origin\n- `permission_required` (403) — the verified credential is not permitted to make this call\n- `signature_required` (403) — creating the agent wallet needs the user's signature: send the user's signature of `creation.message` from Get the agent wallet as `authorization`\n- `asset_not_withdrawable` (403) — tokenized stocks cannot be withdrawn; sell them first\n- `asset_not_swappable` (403) — the swap names an asset this user cannot buy or trade with this request: a tokenized stock with no `context.country`, or one where tokenized stocks are not available, or bought while buying them is not enabled for the user; or a yield vault's share token bought while the user's `earn` flag is off\n- `asset_not_tradable` (403) — the order names an asset this user cannot buy or trade with this request: a tokenized stock with no `context.country`, or one where tokenized stocks are not available, or bought while buying them is not enabled for the user; or a yield vault's share token bought while the user's `earn` flag is off\n- `solana_token_not_tradable` (403) — Fin won't trade this token: its mint lets someone freeze, move or charge for holdings or pause transfers, it can't be sold back, Fin couldn't read its mint, it has no reliable price, or it is wrapped SOL. A sale is refused only for what would stop it landing\n- `limit_orders_disabled` (403) — limit orders are not enabled for this user\n- `grid_trading_disabled` (403) — grid trading is not enabled for this user, so a paused grid cannot be resumed; pausing and cancelling a grid are never gated\n- `deposit_limit_exceeded` (429) — the deposit would take the agent wallet past the user's deposit limit, or, for a deposit address, the wallet has no room left under it; nothing was recorded. Read `depositLimit.availableCents` from Get balances for how much fits now, and deposit no more than that\n- `policy_change_throttled` (429) — the user's Agent API wallet changed what it allows a few minutes ago, and the NEAR Intents Agent API lets it change again only after a cooldown; nothing was asked or signed, so call again once `Retry-After` has passed\n- `agent_slippage_exceeded` (403) — the user's wallet is an Agent API wallet whose agent signs only trades that lose at most the share of their value its owner allowed (`max_slippage_bps`): fees, price and slippage together, by 1Click's own USD values at the quote's minimum output. This trade's quote loses more, states no USD value, or, before there is a quote, its loss bound is already quoted with more slippage than that (half the bound, plus 1Click's fee at the most it has been seen to take, 20 basis points, before an approval). Very small trades lose more to fixed fees; nothing was signed, so ask again with a larger amount or a smaller loss bound\n- `agent_api_orders_unavailable` (403) — the user's Agent API wallet needs wallet setup to enable limit orders, or the order exceeds this wallet's 168-hour maximum; finish wallet setup or choose at most 168 hours before trying again; nothing was approved or signed\n- `destination_not_allowed` (403) — the user's wallet is an Agent API wallet, whose agent pays a deposit only to itself, to a NEAR Intents account its owner listed (on the confidential ledger) or to an address on a chain its owner listed; allow this one with Add a withdrawal destination (one owner signature), then ask again. A public NEAR Intents account, or an address with no valid spelling on its chain, cannot be paid at all; nothing was signed\n- `rate_limited` (429) — the per-key or per-user limit is spent; honour `Retry-After`\n- `partner_request_capacity` (429) — this partner's request quota across all keys and replicas is spent; honour Retry-After\n- `partner_run_capacity` (429) — this partner's active run quota is full; honour Retry-After and reuse the same request identity\n- `stream_capacity` (429) — the partner, user or replica has no free stream capacity; honour `Retry-After`\n- `invalid_cursor` (400) — the `cursor` is not one this list minted\n- `invalid_question_answer` (400) — the questionnaire answer does not match its questions or allowed choices\n- `question_closed` (410) — the questionnaire expired or was cancelled\n- `unknown_target` (400) — a rule names a partner, group or user that does not exist, or a user outside the partners the same rule names\n- `scope_invalid` (400) — a subject in the scope is not a subject id, or appears twice\n- `subject_unsupported` (404) — a subject in the scope is not one market briefs cover; list them with List market subjects\n- `brief_not_found` (404) — no market brief job with this id was created with your partner key\n- `briefs_busy` (429) — your market briefs are at their limit of briefs generating at once; retry after `Retry-After`\n- `market_briefs_disabled` (403) — market briefs are not turned on for your partner key\n- `story_not_found` (404) — no market story with this id is current: it never was one, or Fin no longer shows it because its sources were withdrawn or its figures can no longer be read",
            "type": "string",
            "enum": [
              "run_active",
              "budget_exhausted",
              "approval_not_pending",
              "execution_capacity",
              "execution_unavailable",
              "stop_pending",
              "automation_changed",
              "automation_held",
              "automation_invalid",
              "automation_paused",
              "automation_has_no_webhook",
              "automation_limit",
              "profile_unknown_tool",
              "deployment_paused",
              "run_not_active",
              "withdrawal_changed",
              "swap_changed",
              "order_changed",
              "prediction_order_changed",
              "solana_trade_changed",
              "trade_not_recoverable",
              "order_not_cancelable",
              "grid_not_active",
              "grid_not_paused",
              "suggestion_changed",
              "request_key_conflict",
              "question_not_pending",
              "flag_changed",
              "group_changed",
              "group_in_use",
              "group_name_taken",
              "agent_wallet_required",
              "wallet_account_unsupported",
              "conversation_deleted",
              "automation_deleted",
              "grid_ended",
              "credential_expired",
              "account_disabled",
              "perps_disabled",
              "prediction_disabled",
              "solana_disabled",
              "no_account",
              "not_available_in_region",
              "steering_disabled",
              "baskets_disabled",
              "basket_buying",
              "basket_awaiting_approval",
              "basket_step_not_failed",
              "basket_step_linked",
              "basket_order_not_linkable",
              "voice_disabled",
              "voice_unavailable",
              "provider_unavailable",
              "quote_refused",
              "invalid_input",
              "internal",
              "partner_key_required",
              "partner_key_invalid",
              "subject_mismatch",
              "origin_rejected",
              "permission_required",
              "signature_required",
              "asset_not_withdrawable",
              "asset_not_swappable",
              "asset_not_tradable",
              "solana_token_not_tradable",
              "limit_orders_disabled",
              "grid_trading_disabled",
              "deposit_limit_exceeded",
              "policy_change_throttled",
              "agent_slippage_exceeded",
              "agent_api_orders_unavailable",
              "destination_not_allowed",
              "rate_limited",
              "partner_request_capacity",
              "partner_run_capacity",
              "stream_capacity",
              "invalid_cursor",
              "invalid_question_answer",
              "question_closed",
              "unknown_target",
              "scope_invalid",
              "subject_unsupported",
              "brief_not_found",
              "briefs_busy",
              "market_briefs_disabled",
              "story_not_found"
            ]
          },
          "requestId": {
            "type": "string",
            "description": "The id Fin used for this request; quote it when reporting a problem"
          },
          "retryable": {
            "type": "boolean",
            "description": "Whether repeating the same request later can succeed without changing it"
          },
          "detail": {
            "description": "Only on `invalid_input`: which part of the request failed validation",
            "type": "string"
          },
          "issues": {
            "description": "Only on `invalid_input`: one entry per failing field",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "The JSON pointer of the failing field; empty for the root object"
                },
                "message": {
                  "type": "string",
                  "description": "Why the field failed"
                }
              },
              "required": [
                "path",
                "message"
              ]
            }
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "requestId",
          "retryable"
        ],
        "description": "RFC 9457 problem details: what every error response carries. Never a provider's message, a query or a stack."
      }
    },
    "responses": {
      "InvalidInput": {
        "description": "The request could not be read as this operation expects.\n\n- `invalid_input` — the body or query failed validation; `issues` names each field\n- `invalid_cursor` — the `cursor` is not one this list minted",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "A credential is missing, invalid or expired.\n\n- `partner_key_required` — no `X-Api-Key` header was sent\n- `partner_key_invalid` — the `X-Api-Key` is unknown or revoked\n- `credential_expired` — the user token has expired; obtain a fresh one",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "The body exceeds the size this deployment accepts.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "A limit refused the request; wait for `Retry-After` when it is sent.\n\n- `rate_limited` — the per-key or per-user limit is spent; honour `Retry-After`\n- `partner_request_capacity` — this partner's request quota across all keys and replicas is spent; honour Retry-After",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Internal": {
        "description": "A fault on our side; quote `requestId` when reporting it.\n\n- `internal` — a fault on our side; quote `requestId` when reporting it",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key"
      },
      "userToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "fin_session_<opaque>",
        "description": "A user's session token, from Create a session."
      }
    }
  }
}
```

