{"openapi":"3.0.0","info":{"title":"Nubits API","version":"1.0.6","description":"Web3 actions for your agent."},"servers":[{"url":"https://nubits.xyz"}],"paths":{"/api/health":{"get":{"operationId":"apiHealth","summary":"Health check","description":"Returns API health status","responses":{"200":{"description":"API is healthy","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok"}}}}}}}}},"/api/agent/register":{"post":{"operationId":"registerAgent","summary":"Agent registration","description":"Returns API key and wallet address","responses":{"200":{"description":"Wallet created","content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","example":"0x1234567890abcdef1234567890abcdef12345678"},"apiKey":{"type":"string","example":"5c049a53-0626-4f6b-bd26-495f662d9630"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}}},"/api/agent/status":{"get":{"operationId":"getAgentStatus","summary":"Authentication check","description":"Returns authentication status","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"address","description":"Agent address","required":true,"in":"query","schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","example":"0x1234567890abcdef1234567890abcdef12345678"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok"},"timestamp":{"type":"string","example":"2026-03-30T14:09:22.252Z"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Invalid address"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}}},"/api/agent/balance":{"get":{"operationId":"getAgentBalance","summary":"Get balance","description":"Returns USDC/EURC balance on Sepolia/Base-sepolia.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"address","in":"query","description":"Agent wallet address","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","example":"0x1234567890abcdef1234567890abcdef12345678"}},{"name":"network","in":"query","description":"blockchain network","schema":{"type":"string","enum":["sepolia","base-sepolia"],"default":"sepolia","example":"base-sepolia"}},{"name":"currency","in":"query","description":"cryptocurrency symbol","schema":{"type":"string","enum":["USDC","EURC"],"default":"USDC","example":"EURC"}}],"responses":{"200":{"description":"Balance returned successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}}},"/api/agent/transfer":{"post":{"operationId":"transferFunds","summary":"Transfer USDC/EURC on Sepolia/Base-sepolia","description":"Gasless transaction. ENS supported.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"address","in":"query","description":"Agent address","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","example":"0x1234567890abcdef1234567890abcdef12345678"}},{"name":"network","in":"query","description":"Blockchain network","schema":{"type":"string","enum":["sepolia","base-sepolia"],"default":"sepolia","example":"base-sepolia"}},{"name":"currency","in":"query","description":"Stablecoin symbol","schema":{"type":"string","enum":["USDC","EURC"],"default":"USDC","example":"EURC"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","example":"0x1234567890abcdef1234567890abcdef12345678"},"amount":{"type":"string","description":"Decimal string representation","pattern":"^[0-9]+(\\.[0-9]+)?$","example":"0.75"}}}}}},"responses":{"200":{"description":"Transaction successful","content":{"application/json":{"schema":{"type":"object","properties":{"network":{"type":"string","enum":["sepolia","base-sepolia"],"example":"sepolia"},"hash":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","example":"0x98bdb238cdd400b29a93c3426bbfcd794f3614eed3de6f2ab9d81ba6b2a343b7"},"status":{"type":"string","enum":["pending","confirmed","failed"],"example":"confirmed"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}}},"/api/agent/sign/message":{"post":{"operationId":"signMessage","summary":"Sign personal message","description":"Returns the signature for EIP-191 message","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"address","in":"query","description":"Agent address","schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","example":"0x1234567890abcdef1234567890abcdef12345678"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","example":"hello world"}}}}}},"responses":{"200":{"description":"Signature returned successfully","content":{"application/json":{"schema":{"type":"object","properties":{"signature":{"type":"string","pattern":"^0x[a-fA-F0-9]{130}$","example":"0x1b54ffb042eaefe085d07ad605d96cc6996bc44f8f8542e98f8695925e66c81422489754a5c45df2d02e28eb8d46afb072bbbd4d1a8b3819c987f874793618e81c"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}}},"/api/agent/recover/signer/address":{"post":{"operationId":"recoverSigner","summary":"Recover signer address from signature","description":"Returns the signer of EIP-191 message","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"address","in":"query","description":"Agent address","schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","example":"0x1234567890abcdef1234567890abcdef12345678"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message","signature"],"properties":{"message":{"type":"string","example":"hello world"},"signature":{"type":"string","pattern":"^0x[a-fA-F0-9]{130}$","example":"0x1b54ffb042eaefe085d07ad605d96cc6996bc44f8f8542e98f8695925e66c81422489754a5c45df2d02e28eb8d46afb072bbbd4d1a8b3819c987f874793618e81c"}}}}}},"responses":{"200":{"description":"Signer address returned successfully","content":{"application/json":{"schema":{"type":"object","properties":{"signer":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","example":"0x1234567890abcdef1234567890abcdef12345678"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"name":"x-api-key","description":"API key obtained from /api/agent/register","in":"header","type":"apiKey"}},"schemas":{"BalanceResponse":{"type":"object","properties":{"network":{"type":"string","enum":["sepolia","base-sepolia"]},"currency":{"type":"string","enum":["USDC","EURC"]},"balance":{"type":"string","description":"Decimal string representation","pattern":"^[0-9]+(\\.[0-9]+)?$","example":"0.75"}}},"ErrorMessage":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}}}}}}
