{"openapi":"3.1.0","info":{"title":"Agent Credit API","version":"1.0.0","summary":"Credit assessment infrastructure for autonomous agents.","description":"Register an Agent identity, submit operating signals, retrieve an explainable credit profile, prove EVM wallet ownership and create a prequalification application. Application states are assessment states and do not represent a funds transfer."},"servers":[{"url":"https://raeagent.fun"}],"tags":[{"name":"System"},{"name":"Agents"},{"name":"Assessments"},{"name":"Applications"},{"name":"Wallet"}],"paths":{"/v1/health":{"get":{"tags":["System"],"operationId":"getHealth","summary":"Check API availability","responses":{"200":{"description":"The service is operational."}}}},"/v1/agents":{"post":{"tags":["Agents"],"operationId":"registerAgent","summary":"Register an Agent and issue its API key","responses":{"201":{"description":"Agent registered."},"409":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"description":"The API key is returned once. Store it as a secret and send it with Bearer authentication on subsequent requests.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegistration"}}}}}},"/v1/agents/me":{"get":{"tags":["Agents"],"operationId":"getAuthenticatedAgent","summary":"Retrieve the authenticated Agent identity","responses":{"401":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"agentApiKey":[]}]}},"/v1/agents/me/api-key":{"post":{"tags":["Agents"],"operationId":"rotateAgentApiKey","summary":"Rotate the authenticated Agent API key","responses":{"200":{"description":"Replacement API key issued."},"401":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"agentApiKey":[]}]}},"/v1/agents/{agentId}/credit-profile":{"get":{"tags":["Agents"],"operationId":"getAgentCreditProfile","summary":"Retrieve the Agent's latest credit profile","responses":{"200":{"description":"Latest credit profile."},"401":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"agentApiKey":[]}],"parameters":[{"$ref":"#/components/parameters/AgentId"}]}},"/v1/assessments":{"get":{"tags":["Assessments"],"operationId":"listAssessments","summary":"List the Agent's assessments","responses":{"200":{"description":"Assessment list."},"401":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"agentApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":10000,"default":0}}]},"post":{"tags":["Assessments"],"operationId":"createAssessment","summary":"Calculate a new Agent credit assessment","responses":{"201":{"description":"Assessment completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssessmentEnvelope"}}}},"401":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"agentApiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssessmentInput"}}}}}},"/v1/assessments/{assessmentId}":{"get":{"tags":["Assessments"],"operationId":"getAssessment","summary":"Retrieve one assessment","responses":{"200":{"description":"Assessment record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssessmentEnvelope"}}}},"401":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"agentApiKey":[]}],"parameters":[{"$ref":"#/components/parameters/AssessmentId"}]}},"/v1/applications":{"get":{"tags":["Applications"],"operationId":"listApplications","summary":"List the Agent's applications","responses":{"200":{"description":"Application list."},"401":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"agentApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":10000,"default":0}}]},"post":{"tags":["Applications"],"operationId":"createApplication","summary":"Create a credit prequalification application","responses":{"201":{"description":"Application created and assessed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationEnvelope"}}}},"401":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"agentApiKey":[]}],"description":"Creates a financing-readiness application against an assessment. This endpoint does not transfer or disburse funds.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationInput"}}}}}},"/v1/applications/{applicationId}":{"get":{"tags":["Applications"],"operationId":"getApplication","summary":"Retrieve an application and its current state","responses":{"200":{"description":"Application record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationEnvelope"}}}},"401":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"agentApiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ApplicationId"}]}},"/v1/wallet/challenge":{"post":{"tags":["Wallet"],"operationId":"createWalletChallenge","summary":"Create an EIP-191 ownership challenge","responses":{"201":{"description":"Challenge created."},"400":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"agentApiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletChallengeInput"}}}}}},"/v1/wallet/verify":{"post":{"tags":["Wallet"],"operationId":"verifyWalletOwnership","summary":"Verify a signed ownership challenge","responses":{"200":{"description":"Wallet ownership connected."},"400":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"agentApiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletVerificationInput"}}}}}}},"components":{"securitySchemes":{"agentApiKey":{"type":"http","scheme":"bearer","bearerFormat":"ac_live_<secret>","description":"The API key issued by POST /v1/agents."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"8–128 URL-safe characters. Reusing the same key and body returns the original result.","schema":{"type":"string","minLength":8,"maxLength":128}},"AgentId":{"name":"agentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"AssessmentId":{"name":"assessmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"ApplicationId":{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}},"schemas":{"AgentRegistration":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":80},"externalId":{"type":"string","maxLength":120,"pattern":"^[a-zA-Z0-9._:-]+$"},"description":{"type":"string","maxLength":500},"agentType":{"type":"string","enum":["autonomous","workflow","copilot"],"default":"autonomous"}}},"AssessmentInput":{"type":"object","additionalProperties":false,"required":["monthlyRevenue","historyMonths","revenueStability","topClientShare","successfulTaskRate"],"properties":{"monthlyRevenue":{"type":"integer","minimum":0,"maximum":10000000},"historyMonths":{"type":"integer","minimum":0,"maximum":240},"revenueStability":{"type":"integer","minimum":0,"maximum":100},"topClientShare":{"type":"integer","minimum":0,"maximum":100},"successfulTaskRate":{"type":"integer","minimum":0,"maximum":100}}},"Assessment":{"type":"object","required":["assessmentId","agentId","status","score","estimatedCreditCapacity","confidence","riskBand","factors"],"properties":{"assessmentId":{"type":"string","format":"uuid"},"agentId":{"type":"string","format":"uuid"},"modelVersion":{"type":"string"},"status":{"type":"string","const":"completed"},"sourceType":{"type":"string","const":"api"},"inputFingerprint":{"type":"string"},"monthlyRevenue":{"type":"integer"},"historyMonths":{"type":"integer"},"revenueStability":{"type":"integer","minimum":0,"maximum":100},"topClientShare":{"type":"integer","minimum":0,"maximum":100},"successfulTaskRate":{"type":"integer","minimum":0,"maximum":100},"score":{"type":"integer","minimum":0,"maximum":100},"estimatedCreditCapacity":{"type":"integer","minimum":0},"confidence":{"type":"integer","minimum":0,"maximum":100},"riskBand":{"type":"string","enum":["Low","Moderate","Elevated"]},"factors":{"type":"array","items":{"type":"object","required":["label","score","max"],"properties":{"label":{"type":"string"},"score":{"type":"number"},"max":{"type":"number"}}}},"createdAt":{"type":"string","format":"date-time"}}},"ApplicationInput":{"type":"object","additionalProperties":false,"required":["requestedAmount","purpose"],"properties":{"assessmentId":{"type":"string","format":"uuid"},"requestedAmount":{"type":"integer","minimum":1000,"maximum":5000000},"currency":{"type":"string","const":"USD","default":"USD"},"purpose":{"type":"string","minLength":3,"maxLength":240}}},"Application":{"type":"object","required":["applicationId","agentId","assessmentId","requestedAmount","eligibleAmount","currency","purpose","status"],"properties":{"applicationId":{"type":"string","format":"uuid"},"agentId":{"type":"string","format":"uuid"},"assessmentId":{"type":"string","format":"uuid"},"requestedAmount":{"type":"integer"},"eligibleAmount":{"type":"integer"},"currency":{"type":"string","const":"USD"},"purpose":{"type":"string"},"status":{"type":"string","enum":["prequalified","conditional","more_data_required"],"description":"A credit assessment state. It does not mean funds were transferred."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"WalletChallengeInput":{"type":"object","additionalProperties":false,"required":["address","chainId"],"properties":{"address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"chainId":{"type":"integer","minimum":1}}},"WalletVerificationInput":{"type":"object","additionalProperties":false,"required":["challengeId","address","chainId","signature"],"properties":{"challengeId":{"type":"string","format":"uuid"},"address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"chainId":{"type":"integer","minimum":1},"signature":{"type":"string","pattern":"^0x[a-fA-F0-9]+$"}}},"AssessmentEnvelope":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"assessment":{"$ref":"#/components/schemas/Assessment"}}},"meta":{"type":"object","required":["requestId"],"properties":{"requestId":{"type":"string"},"idempotentReplay":{"type":"boolean"}}}}},"ApplicationEnvelope":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"application":{"$ref":"#/components/schemas/Application"}}},"meta":{"type":"object","required":["requestId"],"properties":{"requestId":{"type":"string"},"idempotentReplay":{"type":"boolean"}}}}},"ErrorEnvelope":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{}}}}}}}}