{"openapi":"3.0.3","info":{"title":"Agentic Scraper API","version":"1.0.0","description":"The canonical API-key-authenticated REST API for Agentic Scraper agents, automations, marketplace operations, provider event charging, logs, and transactions. All public REST operations use this specification and the api.agenticscraper.com origin."},"servers":[{"url":"https://api.agenticscraper.com/api/v1"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Provide your API key in the X-API-Key header."}},"schemas":{"PaginationMeta":{"type":"object","properties":{"page":{"type":"integer","example":1},"pageSize":{"type":"integer","example":10},"total":{"type":"integer","example":42},"totalPages":{"type":"integer","example":5}},"required":["page","pageSize","total","totalPages"]},"SystemLog":{"type":"object","properties":{"id":{"type":"integer"},"userId":{"type":"string","format":"uuid","nullable":true},"logMessage":{"type":"string"},"executedAt":{"type":"string","format":"date-time"}},"required":["id","logMessage","executedAt"]},"AgentTransaction":{"type":"object","properties":{"id":{"type":"integer"},"jobId":{"type":"string","format":"uuid","nullable":true},"userId":{"type":"string","format":"uuid"},"agentName":{"type":"string"},"result":{"type":"string","nullable":true},"payload":{"type":"object","nullable":true,"additionalProperties":true},"cost":{"type":"number"},"executedAt":{"type":"string","format":"date-time"}},"required":["id","userId","agentName","cost","executedAt"]},"Automation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"name":{"type":"string"},"cron":{"type":"string"},"timezone":{"type":"string","nullable":true},"payload":{"type":"object","additionalProperties":true},"status":{"type":"string","enum":["active","paused"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"isPaused":{"type":"boolean"}},"required":["id","userId","name","cron","payload","status","createdAt","updatedAt","isPaused"]},"SocialAccount":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"platform":{"type":"string","enum":["reddit","x"]},"name":{"type":"string"},"isActive":{"type":"boolean"},"validationStatus":{"type":"string","enum":["valid","invalid","unchecked"]},"validationMessage":{"type":"string","nullable":true},"lastValidatedAt":{"type":"string","format":"date-time","nullable":true},"meta":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","userId","platform","name","isActive","validationStatus","meta","createdAt","updatedAt"]},"RedditSocialAccountCredentials":{"type":"object","properties":{"redditClientId":{"type":"string"},"redditClientSecret":{"type":"string"},"redditUserAgent":{"type":"string"},"redditUsername":{"type":"string"},"redditPassword":{"type":"string"}},"required":["redditClientId","redditClientSecret"]},"XSocialAccountCredentials":{"type":"object","properties":{"username":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"totp_secret":{"type":"string","description":"Optional TOTP secret encoded as Base32."},"proxy_country":{"type":"string","description":"Optional proxy country as an ISO alpha-2 code."}},"required":["username","email","password"]},"SocialAccountCreateRequest":{"type":"object","properties":{"platform":{"type":"string","enum":["reddit","x"]},"name":{"type":"string"},"isActive":{"type":"boolean"},"credentials":{"oneOf":[{"$ref":"#/components/schemas/RedditSocialAccountCredentials"},{"$ref":"#/components/schemas/XSocialAccountCredentials"}]}},"required":["platform","name","credentials"]},"SocialAccountUpdateRequest":{"type":"object","properties":{"name":{"type":"string"},"isActive":{"type":"boolean"},"credentials":{"oneOf":[{"$ref":"#/components/schemas/RedditSocialAccountCredentials"},{"$ref":"#/components/schemas/XSocialAccountCredentials"}]}}},"SavedSocialSelection":{"type":"object","properties":{"mode":{"type":"string","enum":["saved"]},"accountIds":{"type":"array","items":{"type":"string","format":"uuid"}},"useAll":{"type":"boolean"}},"required":["mode"]},"RedditInlineSelection":{"type":"object","properties":{"mode":{"type":"string","enum":["inline"]},"credentials":{"$ref":"#/components/schemas/RedditSocialAccountCredentials"}},"required":["mode","credentials"]},"AgentSkillSelection":{"type":"object","properties":{"provider":{"type":"string","example":"skillsmp"},"externalId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"repositoryUrl":{"type":"string","format":"uri","nullable":true},"githubOwner":{"type":"string","nullable":true},"githubRepo":{"type":"string","nullable":true},"sourceUrl":{"type":"string","format":"uri","nullable":true},"version":{"type":"string","nullable":true},"skillMdContent":{"type":"string","nullable":true}},"required":["provider","externalId","name"]},"SkillsConfig":{"type":"object","properties":{"mode":{"type":"string","enum":["none","selected"]},"selected":{"type":"array","items":{"$ref":"#/components/schemas/AgentSkillSelection"}}},"required":["mode"]},"SkillsDirectoryItem":{"allOf":[{"$ref":"#/components/schemas/AgentSkillSelection"},{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"}},"stars":{"type":"number","nullable":true}}}]},"AutomationCreateRequest":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string","description":"Cron expression"},"timezone":{"type":"string"},"task":{"type":"string"},"automation_type":{"type":"string","enum":["reddit-agent","x-agent"]},"llm_provider":{"type":"string"},"llm_model":{"type":"string"},"webhook_url":{"type":"string","format":"uri"},"structured_output":{"type":"array","items":{"type":"object","additionalProperties":true}},"captcha_solver_enabled":{"type":"boolean"},"proxy_enabled":{"type":"boolean"},"proxy_country":{"type":"string"},"reddit":{"oneOf":[{"$ref":"#/components/schemas/SavedSocialSelection"},{"$ref":"#/components/schemas/RedditInlineSelection"}]},"x":{"allOf":[{"$ref":"#/components/schemas/SavedSocialSelection"}],"description":"X agent only supports saved account selection. Inline cookie mode is not supported."},"skills":{"$ref":"#/components/schemas/SkillsConfig"},"market_mcps":{"type":"array","items":{"$ref":"#/components/schemas/MarketMcpSelectionRequest"},"default":[]},"custom_mcps":{"type":"array","items":{"$ref":"#/components/schemas/CustomMcpSelectionRequest"},"default":[]}},"required":["name","cron","task","automation_type"]},"ApiScrapeJob":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","processing","completed","failed"]},"request":{"type":"object","additionalProperties":true},"result":{"type":"object","nullable":true,"additionalProperties":true},"error":{"type":"string","nullable":true},"logs":{"type":"array","items":{"type":"string"}},"webhookUrl":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","userId","status","request","logs","createdAt","updatedAt"]},"ScrapeRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL to scrape."},"llm_provider":{"type":"string","enum":["agentic_scraper","openrouter"],"description":"Enabled LLM provider. Agentic Scraper uses the platform OpenRouter account and wallet billing; OpenRouter uses the account API key.","default":"agentic_scraper"},"llm_model":{"type":"string","description":"LLM model name. Defaults to gpt-4o-mini.","default":"gpt-4o-mini"},"webhook_url":{"type":"string","format":"uri","description":"Optional webhook URL."},"cookies":{"description":"Optional cookie data. Accepts a string, array, or object.","oneOf":[{"type":"string"},{"type":"array"},{"type":"object"}]},"structured_output":{"description":"A field list in array format or a JSON Schema. The default output is used when omitted.","oneOf":[{"type":"array"},{"type":"object"}]},"system_prompt":{"type":"string","description":"Optional system prompt."},"captcha_solver_enabled":{"type":"boolean","description":"Whether CAPTCHA solving is enabled. Defaults to false.","default":false},"mobile_proxy_enabled":{"type":"boolean","description":"Whether to use a mobile proxy. Defaults to false.","default":false},"mobile_proxy_country":{"type":"string","description":"Mobile proxy country code. Defaults to US.","default":"US"},"async":{"type":"boolean","description":"Whether to run asynchronously. Defaults to true.","default":true}},"required":["url"]},"ScrapeAsyncResponse":{"type":"object","properties":{"jobId":{"type":"string","format":"uuid"},"status":{"type":"string"}},"required":["jobId","status"]},"ApiAgenticJob":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","processing","completed","failed"]},"request":{"type":"object","additionalProperties":true},"result":{"type":"object","nullable":true,"additionalProperties":true},"error":{"type":"string","nullable":true},"logs":{"type":"array","items":{"type":"string"}},"webhookUrl":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","userId","status","request","logs","createdAt","updatedAt"]},"AgenticScraperRequest":{"type":"object","properties":{"task":{"type":"string","description":"Required task instructions."},"llm_provider":{"type":"string","enum":["agentic_scraper","openrouter"],"description":"Use agentic_scraper for a platform-managed OpenRouter model billed from the wallet, or openrouter with the account API key. All other providers are disabled.","default":"agentic_scraper"},"llm_model":{"type":"string","description":"Model identifier accepted by the selected provider. Platform-managed examples include openrouter/auto, deepseek/deepseek-chat-v3-0324, and google/gemini-2.5-flash.","default":"openrouter/auto"},"headless":{"type":"boolean","description":"Runs the browser without a visible window. Defaults to false to preserve headful behavior.","default":false},"vision_mode":{"type":"string","enum":["auto","visual","text_only"],"description":"Controls agent vision behavior: auto uses screenshots when needed, visual always uses vision, and text_only disables screenshot tools.","default":"auto"},"vision_detail_level":{"type":"string","enum":["auto","low","high"],"description":"Vision screenshot detail level.","default":"auto"},"optimization_mode":{"type":"string","enum":["balanced","speed","consistency"],"description":"Agent execution profile. speed favors flash mode and shorter waits, while consistency favors more conservative settings.","default":"balanced"},"max_actions_per_step":{"type":"integer","minimum":1,"maximum":20,"description":"Maximum number of browser actions allowed per step."},"follow_up_tasks":{"type":"array","description":"Additional tasks to execute sequentially after the main task in the same browser session.","items":{"type":"string"}},"cookies":{"description":"Optional cookie data. Accepts a string or object.","oneOf":[{"type":"string"},{"type":"object"}]},"sensitive_data":{"description":"Optional list of sensitive values.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"string"},"domain_pattern":{"type":"string","description":"Optional domain scope. When provided, the secret is made available only while interacting with matching domains."}},"required":["id","value"]}},"structured_output":{"description":"Optional structured output field list. Defaults to a result string when omitted.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"]}},"webhook_url":{"type":"string","format":"uri","description":"Optional webhook URL."},"captcha_solver_enabled":{"type":"boolean","description":"Whether CAPTCHA solving is enabled. Defaults to false.","default":false},"proxy_enabled":{"type":"boolean","description":"Whether to use a proxy. Defaults to false.","default":false},"proxy_country":{"type":"string","description":"Proxy country code. Required when proxy use is enabled."}},"required":["task"]},"AgenticScraperAsyncResponse":{"type":"object","properties":{"jobId":{"type":"string","format":"uuid"},"status":{"type":"string"}},"required":["jobId","status"]},"MarketMcpSelectionRequest":{"type":"object","properties":{"mcp_id":{"type":"string","format":"uuid"},"tool_names":{"type":"array","items":{"type":"string"},"default":[]},"params":{"type":"object","additionalProperties":true,"default":{}}},"required":["mcp_id"]},"CustomMcpSelectionRequest":{"type":"object","properties":{"type":{"type":"string","enum":["remote_mcp","openapi"]},"name":{"type":"string","nullable":true},"source_url":{"type":"string","format":"uri","nullable":true},"openapi_spec":{"nullable":true,"description":"OpenAPI JSON object/string when type is openapi."},"tool_names":{"type":"array","items":{"type":"string"},"default":[]},"params":{"type":"object","additionalProperties":true,"default":{}},"tool_discovery_cache":{"type":"object","additionalProperties":true,"default":{}}},"required":["type"]},"CustomAgentRequest":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string","description":"Cron expression for scheduled agents. Optional for /agents/run."},"task":{"type":"string"},"system_prompt":{"type":"string","nullable":true},"expected_output":{"type":"string","nullable":true},"llm_provider":{"type":"string","enum":["openrouter","agentic_scraper"],"default":"agentic_scraper"},"llm_model":{"type":"string","description":"Model identifier accepted by the selected provider. With agentic_scraper, OpenRouter model identifiers such as deepseek/deepseek-chat-v3-0324 and google/gemini-2.5-flash are supported.","default":"openrouter/auto"},"max_tool_calls":{"type":"integer","minimum":1,"default":20,"description":"Maximum MCP tool invocations for the entire execution. This limits tool loops and bounds paid MCP usage."},"skills":{"type":"array","items":{"$ref":"#/components/schemas/AgentSkillSelection"},"default":[]},"market_mcps":{"type":"array","items":{"$ref":"#/components/schemas/MarketMcpSelectionRequest"},"default":[]},"custom_mcps":{"type":"array","items":{"$ref":"#/components/schemas/CustomMcpSelectionRequest"},"default":[]}},"required":["task"]},"CustomAgentResponse":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"payload":{"type":"object","additionalProperties":true}},"required":["id","name","payload"]}},"required":["agent"]},"CustomAgentRunResponse":{"type":"object","properties":{"queued":{"type":"boolean","description":"True when the API-only execution was accepted by the queue."},"jobId":{"type":"string","format":"uuid","description":"API-only run ID used with GET /agents/runs/{jobId}; this is not an automation ID."},"status":{"type":"string","enum":["pending"]}},"required":["queued","jobId","status"]},"McpDiscoveryRequest":{"type":"object","properties":{"type":{"type":"string","enum":["remote_mcp","openapi"]},"url":{"type":"string","format":"uri"},"specText":{"type":"string"},"spec":{"nullable":true,"description":"Parsed OpenAPI spec object."}},"required":["type"]},"McpDiscoveryResponse":{"type":"object","properties":{"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"inputSchema":{"type":"object","additionalProperties":true,"nullable":true}},"required":["name"]}},"params":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["tools"]},"MarketIdResponse":{"type":"object","description":"Identifier returned after a market submission or revision is created.","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the newly created submission."}},"required":["id"]},"MarketToolDefinition":{"type":"object","description":"A tool exposed by an MCP server or derived from an OpenAPI operation.","properties":{"toolName":{"type":"string","description":"Stable machine-readable tool name."},"displayName":{"type":"string","description":"Human-readable tool name shown in the market."},"description":{"type":"string","nullable":true,"description":"Explanation of what the tool does and when it should be used."},"inputSchema":{"type":"object","additionalProperties":true,"description":"JSON Schema describing the arguments accepted by the tool."},"clientPriceUsd":{"type":"number","minimum":0,"description":"Price charged to the consumer for each authorized upstream tool-call attempt when fixed per-tool pricing is enabled. The attempt remains billable when the upstream tool returns an error because provider resources were consumed; requests rejected before an upstream invocation are not charged."},"providerRevenueUsd":{"type":"number","minimum":0,"description":"Informational provider revenue value. Final settlement values are calculated by the platform."},"isEnabled":{"type":"boolean","default":true,"description":"Whether consumers may invoke this tool."}},"required":["toolName","displayName"]},"MarketPricingEvent":{"type":"object","description":"A provider-reported billable event available to an MCP configured for provider event pricing.","properties":{"eventName":{"type":"string","description":"Stable unique event name used by the provider charge API."},"title":{"type":"string","description":"Human-readable event title."},"description":{"type":"string","nullable":true,"description":"Description of the billable action represented by the event."},"unitPriceUsd":{"type":"number","minimum":0,"exclusiveMinimum":true,"description":"USD price charged for one event unit."},"providerRevenueUsd":{"type":"number","minimum":0,"description":"Optional requested provider revenue. Final settlement is controlled by platform commission settings."}},"required":["eventName","unitPriceUsd"]},"McpMarketSubmissionRequest":{"type":"object","description":"Complete MCP or OpenAPI market submission. Discovery and validation must be completed first. Updates use the same full-replacement payload so omitted fields are not accidentally retained.","properties":{"validationId":{"type":"string","format":"uuid","description":"ID of a successful validation owned by the API key owner and matching the submitted source fingerprint."},"sourceFingerprint":{"type":"string","minLength":64,"maxLength":64,"description":"SHA-256 source fingerprint returned by the validation endpoint. It prevents source changes after validation."},"eventVerificationId":{"type":"string","format":"uuid","nullable":true,"description":"Completed event verification ID. Required only for provider_event monetization."},"slug":{"type":"string","description":"Optional URL-safe identifier. The platform normalizes it; when omitted it is derived from name."},"type":{"type":"string","enum":["remote_mcp","openapi"],"description":"Source type. remote_mcp connects to a remote MCP server; openapi imports an API specification."},"name":{"type":"string","description":"Market display name."},"description":{"type":"string","nullable":true,"description":"Detailed public description of the integration and its capabilities."},"iconUrl":{"type":"string","format":"uri","nullable":true,"description":"Public icon URL, normally returned by the icon upload endpoint."},"iconObjectKey":{"type":"string","nullable":true,"description":"Storage object key returned by the icon upload endpoint. It must belong to the submitting user."},"remoteMcpUrl":{"type":"string","format":"uri","nullable":true,"description":"HTTPS MCP endpoint. Required for remote_mcp sources. Localhost, loopback, private-network and unsafe redirect targets are rejected during discovery."},"openapiBaseUrl":{"type":"string","format":"uri","nullable":true,"description":"Optional absolute HTTPS API base URL for an OpenAPI source. It overrides the root servers entry and is required when an uploaded or pasted document has no absolute resolvable server URL. The resolved value is included in validation fingerprints and used for runtime tool calls."},"openapiSpec":{"type":"object","additionalProperties":true,"description":"Parsed OpenAPI document. Required for openapi sources unless openapiSpecText is provided."},"openapiSpecText":{"type":"string","description":"OpenAPI JSON or YAML text. Used when a parsed openapiSpec object is not supplied."},"discoveryCache":{"type":"object","additionalProperties":true,"description":"Discovery result returned by the discover or validate endpoint."},"staticConfig":{"type":"object","additionalProperties":true,"description":"Provider-owned configuration stored encrypted by the market service. Do not place consumer-specific values here."},"requiredUserParamsSchema":{"type":"object","additionalProperties":true,"description":"Schema for values each consumer must provide when installing the integration. Secret fields should be marked as secret in the schema metadata."},"monetizationStrategy":{"type":"string","enum":["free","provider_event","tool_call_fixed"],"description":"Billing strategy: no charge, verified provider-reported events, or a fixed amount per authorized upstream tool-call attempt, including attempts that return an upstream error."},"pricingEvents":{"type":"array","items":{"$ref":"#/components/schemas/MarketPricingEvent"},"default":[],"description":"Verified event catalog. Required and non-empty for provider_event monetization; ignored for other strategies."},"tools":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/MarketToolDefinition"},"description":"Tools exposed to consumers. OpenAPI sources may derive this list automatically, but sending the reviewed list is recommended."}},"required":["validationId","sourceFingerprint","type","name","monetizationStrategy"]},"McpMarketSubmission":{"type":"object","description":"Private owner view of an MCP or OpenAPI submission. It includes review status and provider configuration and is returned only to the owning API key.","additionalProperties":true,"properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"type":{"type":"string","enum":["remote_mcp","openapi"]},"name":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","pending_review","approved","rejected","disabled"]},"parentEntryId":{"type":"string","format":"uuid","nullable":true},"remoteMcpUrl":{"type":"string","format":"uri","nullable":true},"openapiSpec":{"nullable":true},"staticConfig":{"type":"object","additionalProperties":true},"requiredUserParamsSchema":{"type":"object","additionalProperties":true},"monetizationStrategy":{"type":"string","enum":["free","provider_event","tool_call_fixed"]},"pricingEvents":{"type":"array","items":{"$ref":"#/components/schemas/MarketPricingEvent"}},"tools":{"type":"array","items":{"$ref":"#/components/schemas/MarketToolDefinition"}}},"required":["id","slug","type","name","status","tools"]},"McpMarketPublicEntry":{"type":"object","description":"Public approved MCP or OpenAPI market listing. Provider secrets, source configuration, ownership, and review metadata are intentionally omitted.","additionalProperties":true,"properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"type":{"type":"string","enum":["remote_mcp","openapi"]},"name":{"type":"string"},"description":{"type":"string","nullable":true},"iconUrl":{"type":"string","format":"uri","nullable":true},"monetizationStrategy":{"type":"string","enum":["free","provider_event","tool_call_fixed"]},"requiredUserParamsSchema":{"type":"object","additionalProperties":true},"pricingEvents":{"type":"array","items":{"$ref":"#/components/schemas/MarketPricingEvent"}},"tools":{"type":"array","items":{"$ref":"#/components/schemas/MarketToolDefinition"}}},"required":["id","slug","type","name","monetizationStrategy","tools"]},"McpMarketDiscoveryRequest":{"type":"object","description":"Source discovery request used before validation and submission. Network destinations are checked against SSRF protections and remote MCP sources must use HTTPS.","properties":{"type":{"type":"string","enum":["remote_mcp","openapi"]},"url":{"type":"string","format":"uri","description":"Remote MCP URL or remotely hosted OpenAPI document URL."},"openapiBaseUrl":{"type":"string","format":"uri","description":"Optional absolute HTTPS API base URL override for OpenAPI discovery and live validation. It is ignored for remote MCP sources."},"specText":{"type":"string","description":"Inline OpenAPI JSON or YAML."},"spec":{"description":"Parsed inline OpenAPI document."},"params":{"type":"object","additionalProperties":true,"default":{},"description":"Temporary discovery parameters such as authentication values. Values are used for discovery and are not returned in public catalog responses."}},"required":["type"]},"McpMarketValidationResponse":{"type":"object","description":"Validation result bound to the authenticated owner and exact source fingerprint.","properties":{"validationId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["valid","invalid","needs_parameters"]},"sourceFingerprint":{"type":"string","minLength":64,"maxLength":64},"parametersRequired":{"type":"boolean"},"report":{"type":"object","additionalProperties":true,"description":"Contract validation report including issues, tool count and quality score where available."},"discovery":{"type":"object","additionalProperties":true,"description":"Normalized tools, parameters and source metadata discovered from the source."}},"required":["validationId","status","sourceFingerprint","report"]},"MarketEventVerificationRequest":{"type":"object","description":"Starts verification for every provider_event pricing event before a submission may reference those events.","properties":{"sourceFingerprint":{"type":"string","minLength":64,"maxLength":64},"eventNames":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"}}},"required":["sourceFingerprint","eventNames"]},"MarketEventVerification":{"type":"object","description":"Short-lived provider event verification state scoped to the authenticated owner.","properties":{"id":{"type":"string","format":"uuid"},"runId":{"type":"string","format":"uuid"},"sourceFingerprint":{"type":"string"},"eventNames":{"type":"array","items":{"type":"string"}},"verifiedEventNames":{"type":"array","items":{"type":"string"}},"complete":{"type":"boolean"},"expiresAt":{"type":"string","format":"date-time"},"chargeToken":{"type":"string","description":"Short-lived signed token returned only when verification is created. Treat it as a secret."},"apiBaseUrl":{"type":"string","format":"uri","description":"Canonical public REST API base URL to use for provider event verification and production charges."}},"required":["id","runId","eventNames","expiresAt"]},"ProviderEventChargeRequest":{"type":"object","description":"Reports a provider-defined billable event that occurred during one authorized marketplace run. The event name must exist in the approved listing, count must represent only units actually produced, and metadata must not contain secrets or personal data.","properties":{"eventName":{"type":"string","minLength":1,"description":"Exact provider event name configured in the approved marketplace listing.","example":"record-returned"},"count":{"type":"integer","minimum":1,"default":1,"description":"Number of event units to charge. The response chargedCount may be lower when the buyer run limit is nearly exhausted.","example":25},"toolName":{"type":"string","nullable":true,"description":"Optional MCP tool name that produced the event. Use it for attribution when several tools emit the same event.","example":"search_records"},"metadata":{"type":"object","additionalProperties":true,"default":{},"description":"Optional non-sensitive JSON metadata retained for provider-side usage attribution and diagnostics."}},"required":["eventName"]},"ProviderEventChargeResult":{"type":"object","description":"Authoritative result of an idempotent provider event charge. Providers must limit returned or fulfilled units to chargedCount.","properties":{"chargeId":{"type":"string","description":"Stable charge identifier, or a verification identifier when verification is true."},"eventName":{"type":"string"},"requestedCount":{"type":"integer"},"chargedCount":{"type":"integer","description":"Number of units accepted for this run. This can be lower than requestedCount because of the run charge limit."},"chargeableWithinLimit":{"type":"integer"},"eventChargeLimitReached":{"type":"boolean"},"unitPriceUsd":{"type":"number","format":"double"},"totalChargedUsd":{"type":"number","format":"double"},"commissionRate":{"type":"number","format":"double"},"commissionUsd":{"type":"number","format":"double"},"providerRevenueUsd":{"type":"number","format":"double"},"openmeterEventId":{"type":"string","description":"Internal settlement event identifier retained for backward-compatible response parsing."},"replayed":{"type":"boolean","description":"True when this idempotency key was already processed and the original result was returned."},"verification":{"type":"boolean","description":"True for a no-debit event verification request."}},"required":["chargeId","eventName","requestedCount","chargedCount","chargeableWithinLimit","eventChargeLimitReached","unitPriceUsd","totalChargedUsd","commissionRate","commissionUsd","providerRevenueUsd","openmeterEventId","replayed"]},"MarketIconUploadRequest":{"type":"object","description":"PNG icon upload encoded as base64. The market service validates the media type and stores the object under the authenticated owner.","properties":{"fileName":{"type":"string"},"contentType":{"type":"string","enum":["image/png"]},"base64":{"type":"string","format":"byte"}},"required":["fileName","contentType","base64"]},"AgentMarketSubmissionRequest":{"type":"object","description":"Complete Agent Market submission. Prompts are encrypted at rest. Updates replace the editable configuration and approved agents require a revision instead of direct mutation.","properties":{"slug":{"type":"string","description":"Optional normalized market slug; derived from name when omitted."},"name":{"type":"string","description":"Public agent name."},"description":{"type":"string","nullable":true,"description":"Public explanation of the agent use case and behavior."},"iconUrl":{"type":"string","format":"uri","nullable":true},"iconObjectKey":{"type":"string","nullable":true},"priceUsd":{"type":"number","minimum":0,"default":0,"description":"One-time purchase price in USD. Zero publishes a free agent."},"suggestedLlmProvider":{"type":"string","description":"Recommended LLM provider resolved when the agent runs."},"suggestedLlmModel":{"type":"string","description":"Recommended model identifier."},"runMode":{"type":"string","enum":["template","task"],"description":"template renders promptTemplate from declared inputs; task accepts a task at execution time."},"systemPrompt":{"type":"string","description":"Private system instructions encrypted at rest and never returned in public catalog responses."},"promptTemplate":{"type":"string","nullable":true,"description":"Template rendered from inputSchema values. Required when runMode is template."},"inputSchema":{"type":"object","additionalProperties":true,"description":"JSON-compatible schema describing template input fields."},"structuredOutput":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"]}},"skills":{"type":"object","additionalProperties":true,"description":"Selected reusable skills and their configuration."},"mcpSelections":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"MCP Market tool selections available to the agent."},"customMcpSelections":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"Owner-configured remote MCP or OpenAPI selections available to the agent."}},"required":["name","suggestedLlmProvider","suggestedLlmModel","runMode","systemPrompt"]},"AgentMarketSubmission":{"type":"object","description":"Private owner view of an Agent Market submission, including encrypted-at-rest prompt material after authorized decryption.","additionalProperties":true,"properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","pending_review","approved","rejected","disabled"]},"parentEntryId":{"type":"string","format":"uuid","nullable":true},"priceUsd":{"type":"number"},"suggestedLlmProvider":{"type":"string"},"suggestedLlmModel":{"type":"string"},"runMode":{"type":"string","enum":["template","task"]},"systemPrompt":{"type":"string"},"promptTemplate":{"type":"string","nullable":true},"inputSchema":{"type":"object","additionalProperties":true},"structuredOutput":{"type":"array","items":{"type":"object","additionalProperties":true}},"skills":{"type":"object","additionalProperties":true},"mcpSelections":{"type":"array","items":{"type":"object","additionalProperties":true}},"customMcpSelections":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["id","slug","name","status","priceUsd","runMode","systemPrompt"]},"AgentMarketPublicEntry":{"type":"object","description":"Public approved Agent Market listing. Private prompts, provider identity and review metadata are intentionally omitted.","additionalProperties":true,"properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"iconUrl":{"type":"string","format":"uri","nullable":true},"priceUsd":{"type":"number","minimum":0},"suggestedLlmProvider":{"type":"string"},"suggestedLlmModel":{"type":"string"},"runMode":{"type":"string","enum":["template","task"]},"inputSchema":{"type":"object","additionalProperties":true},"structuredOutput":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["id","slug","name","priceUsd","runMode"]},"MarketAgentRunRequest":{"type":"object","properties":{"inputs":{"type":"object","additionalProperties":true,"description":"Values required by template-mode agents. The keys must match the market agent input schema."},"task":{"type":"string","description":"Task to execute. Required by task-mode agents and may override the default task when the listing permits it."},"llm_provider":{"type":"string","enum":["agentic_scraper","openrouter"],"description":"Optional enabled LLM provider override. If omitted, the agent listing recommendation is used."},"llm_model":{"type":"string","description":"Optional LLM model override. If omitted, the agent listing recommendation is used."},"webhook_url":{"type":"string","format":"uri","description":"Optional HTTPS endpoint that receives the completed or failed run result."},"headless":{"type":"boolean","default":false,"description":"Runs browser-based agents without a visible browser window when true."}}},"MarketAgentRunResponse":{"type":"object","properties":{"jobId":{"type":"string","format":"uuid","description":"Identifier used to poll the market agent run."},"status":{"type":"string","enum":["pending"],"description":"Initial queued state of the run."}},"required":["jobId","status"]}}},"paths":{"/logs":{"get":{"summary":"List system logs","description":"Returns system logs that belong to the authenticated user.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"page","in":"query","description":"Page number for pagination.","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","description":"Number of logs per page (max 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}}],"responses":{"200":{"description":"Paginated list of system logs.","content":{"application/json":{"schema":{"type":"object","properties":{"logs":{"type":"array","items":{"$ref":"#/components/schemas/SystemLog"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["logs","meta"]}}}},"401":{"description":"Missing or invalid API key."}}}},"/transactions":{"get":{"summary":"List agent transactions","description":"Returns transaction records that belong to the authenticated user.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"page","in":"query","description":"Page number for pagination.","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","description":"Number of transactions per page (max 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}}],"responses":{"200":{"description":"Paginated list of agent transactions.","content":{"application/json":{"schema":{"type":"object","properties":{"transactions":{"type":"array","items":{"$ref":"#/components/schemas/AgentTransaction"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["transactions","meta"]}}}},"401":{"description":"Missing or invalid API key."}}}},"/automations":{"get":{"summary":"List automations","description":"Returns all automations (active and paused) for the authenticated user.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"page","in":"query","description":"Page number for pagination.","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","description":"Number of automations per page (max 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}}],"responses":{"200":{"description":"Paginated list of automations.","content":{"application/json":{"schema":{"type":"object","properties":{"automations":{"type":"array","items":{"$ref":"#/components/schemas/Automation"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["automations","meta"]}}}},"401":{"description":"Missing or invalid API key."}}},"post":{"summary":"Create Reddit/X automation","description":"Creates a persistent recurring Reddit or X automation for the authenticated user, registers its cron schedule, and queues its first execution immediately. Use the dedicated one-off endpoints for operations that must not create an automation record.","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationCreateRequest"},"examples":{"redditSavedAccount":{"summary":"Schedule a Reddit agent with a saved account","value":{"name":"Daily subreddit research","cron":"0 9 * * *","timezone":"Europe/Istanbul","task":"Find the highest-signal posts in r/LocalLLaMA and summarize recurring topics.","automation_type":"reddit-agent","llm_provider":"agentic_scraper","llm_model":"deepseek/deepseek-chat-v3-0324","reddit":{"mode":"saved","accountIds":["11111111-1111-4111-8111-111111111111"]},"structured_output":[{"id":"summary","type":"string"},{"id":"post_urls","type":"string[]"}]}},"redditInlineCredentials":{"summary":"Schedule a Reddit agent with inline credentials","value":{"name":"Reddit trend monitor","cron":"0 */6 * * *","timezone":"UTC","task":"Report newly emerging discussions about browser agents.","automation_type":"reddit-agent","reddit":{"mode":"inline","credentials":{"redditClientId":"<reddit-client-id>","redditClientSecret":"<reddit-client-secret>","redditUserAgent":"my-product/1.0"}}}},"xSavedAccount":{"summary":"Schedule an X agent with a saved account","value":{"name":"Daily X competitor report","cron":"30 8 * * *","timezone":"Europe/Istanbul","task":"Review the latest posts and produce a competitor activity report.","automation_type":"x-agent","llm_provider":"agentic_scraper","llm_model":"google/gemini-2.5-flash","x":{"mode":"saved","accountIds":["22222222-2222-4222-8222-222222222222"]},"captcha_solver_enabled":true,"proxy_enabled":true,"proxy_country":"US"}}}}}},"responses":{"201":{"description":"Created automation.","content":{"application/json":{"schema":{"type":"object","properties":{"automation":{"$ref":"#/components/schemas/Automation"}},"required":["automation"]}}}},"400":{"description":"Invalid request body."},"401":{"description":"Missing or invalid API key."},"403":{"description":"Package automation limit exceeded."}}}},"/skills/directory/search":{"get":{"summary":"Search skills directory","description":"Search skills from the configured skills directory provider.","security":[{"ApiKeyAuth":[]}],"parameters":[{"in":"query","name":"q","required":true,"schema":{"type":"string"}},{"in":"query","name":"page","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"Skills directory search results.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SkillsDirectoryItem"}},"meta":{"type":"object","properties":{"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer"}},"required":["page","pageSize","total"]}},"required":["items","meta"]}}}}}}},"/skills/directory/ai-search":{"get":{"summary":"AI search skills directory","description":"AI-optimized search in the configured skills directory provider.","security":[{"ApiKeyAuth":[]}],"parameters":[{"in":"query","name":"q","required":true,"schema":{"type":"string"}},{"in":"query","name":"page","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"in":"query","name":"pageSize","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"Skills directory AI search results.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SkillsDirectoryItem"}},"meta":{"type":"object","properties":{"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer"}},"required":["page","pageSize","total"]}},"required":["items","meta"]}}}}}}},"/social-accounts":{"get":{"summary":"List social accounts","description":"Returns saved Reddit/X accounts for the authenticated API key owner.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"platform","in":"query","required":false,"schema":{"type":"string","enum":["reddit","x"]}}],"responses":{"200":{"description":"List of saved social accounts.","content":{"application/json":{"schema":{"type":"object","properties":{"accounts":{"type":"array","items":{"$ref":"#/components/schemas/SocialAccount"}}},"required":["accounts"]}}}},"401":{"description":"Missing or invalid API key."}}},"post":{"summary":"Create social account","description":"Validates Reddit or X credentials against the upstream platform integration before saving an account owned by the authenticated user. Credentials are encrypted at rest and are never returned by list or mutation responses.","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialAccountCreateRequest"},"examples":{"reddit":{"summary":"Validate and save a Reddit account","value":{"platform":"reddit","name":"Production Reddit app","isActive":true,"credentials":{"redditClientId":"<reddit-client-id>","redditClientSecret":"<reddit-client-secret>","redditUserAgent":"my-product/1.0"}}},"x":{"summary":"Validate and save an X account","value":{"platform":"x","name":"Research X account","isActive":true,"credentials":{"username":"<x-username>","email":"<account-email>","password":"<account-password>","totp_secret":"<optional-base32-totp-secret>","proxy_country":"US"}}}}}}},"responses":{"201":{"description":"Created social account.","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/SocialAccount"}},"required":["account"]}}}},"400":{"description":"Validation failed."},"401":{"description":"Missing or invalid API key."}}}},"/social-accounts/{id}":{"patch":{"summary":"Update social account","description":"Updates social account metadata and/or credentials.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialAccountUpdateRequest"},"examples":{"disableAndRename":{"summary":"Rename and disable a saved account","value":{"name":"Research X account — paused","isActive":false}},"replaceRedditCredentials":{"summary":"Replace and revalidate Reddit credentials","value":{"credentials":{"redditClientId":"<new-client-id>","redditClientSecret":"<new-client-secret>","redditUserAgent":"my-product/2.0"}}}}}}},"responses":{"200":{"description":"Updated social account.","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/SocialAccount"}},"required":["account"]}}}},"400":{"description":"Validation failed."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Social account not found."}}},"delete":{"summary":"Delete social account","description":"Deletes a saved social account.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Social account not found."}}}},"/scrape":{"post":{"summary":"Scrape from URL","description":"Starts a one-off scrape operation. Asynchronous mode returns a jobId, while synchronous mode returns the result payload. Requests are subject to the user plan limits.","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScrapeRequest"},"examples":{"asynchronous":{"summary":"Queue a URL scrape and poll its status","value":{"url":"https://example.com/products","async":true,"structured_output":[{"id":"product_names","type":"string[]"},{"id":"prices","type":"string[]"}]}},"synchronous":{"summary":"Wait for a URL scrape result","value":{"url":"https://example.com/article","async":false,"structured_output":[{"id":"title","type":"string"},{"id":"body","type":"string"}]}}}}}},"responses":{"200":{"description":"Synchronous scrape result.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"202":{"description":"Asynchronous job created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScrapeAsyncResponse"}}}},"400":{"description":"Invalid parameters."},"401":{"description":"Missing or invalid API key."},"429":{"description":"Monthly operation limit reached."}}}},"/scrape/status/{jobId}":{"get":{"summary":"Scrape job status","description":"Returns the scrape job status and results for the provided jobId.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"jobId","in":"path","required":true,"description":"Scrape job UUID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Scrape job record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiScrapeJob"}}}},"401":{"description":"Missing or invalid API key."},"404":{"description":"Job not found."}}}},"/agenticscraper":{"post":{"summary":"Run agentic scraper (one-off)","description":"Starts a one-off Agentic Scraper run and returns a jobId. This is the on-demand version of the agentic automation workflow.","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgenticScraperRequest"},"examples":{"browserResearch":{"summary":"Run an autonomous browser task once","value":{"task":"Visit the target site, compare the pricing plans, and return their limits.","llm_provider":"agentic_scraper","llm_model":"google/gemini-2.5-flash","vision_mode":"auto","optimization_mode":"balanced","max_actions_per_step":8,"structured_output":[{"id":"plans","type":"string[]"},{"id":"summary","type":"string"}],"headless":true}}}}}},"responses":{"202":{"description":"Asynchronous job created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgenticScraperAsyncResponse"}}}},"400":{"description":"Invalid parameters."},"401":{"description":"Missing or invalid API key."},"429":{"description":"Monthly operation limit reached."}}}},"/agenticscraper/status/{jobId}":{"get":{"summary":"Agentic scraper job status","description":"Returns the Agentic Scraper job status and results for the provided jobId.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"jobId","in":"path","required":true,"description":"Agentic job UUID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Agentic Scraper job record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiAgenticJob"}}}},"401":{"description":"Missing or invalid API key."},"404":{"description":"Job not found."}}}},"/agents":{"post":{"summary":"Create custom agent","description":"Creates a scheduled custom agent with prompts, LLM configuration, skills, MCP Market tools, and private MCP/OpenAPI tools.","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomAgentRequest"},"examples":{"scheduledCustomAgent":{"summary":"Schedule a custom agent with an MCP Market tool","value":{"name":"Weekly documentation analyst","cron":"0 10 * * 1","task":"Review the selected documentation source and report important changes.","system_prompt":"Use tools for factual claims and include source URLs.","expected_output":"A concise changelog with links.","llm_provider":"agentic_scraper","llm_model":"google/gemini-2.5-flash","max_tool_calls":12,"structured_output":[{"id":"summary","type":"string"},{"id":"sources","type":"string[]"}],"market_mcps":[{"mcp_id":"33333333-3333-4333-8333-333333333333","tool_names":["search_documentation"],"params":{}}]}}}}}},"responses":{"201":{"description":"Created custom agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomAgentResponse"}}}},"400":{"description":"Invalid custom agent payload."},"401":{"description":"Missing or invalid API key."}}}},"/agents/run":{"post":{"summary":"Run custom agent once","description":"Queues exactly one API-only custom agent execution. It does not create a cron job or dashboard automation record. Poll GET /agents/runs/{jobId} until the run is completed or failed.","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomAgentRequest"},"examples":{"oneOffCustomAgent":{"summary":"Run a tool-enabled custom agent without creating an automation","value":{"name":"One-off documentation researcher","task":"Use the selected documentation tools to explain provider event charging.","system_prompt":"Use tools before answering and cite retrieved documentation.","llm_provider":"agentic_scraper","llm_model":"deepseek/deepseek-chat-v3-0324","max_tool_calls":10,"market_mcps":[{"mcp_id":"33333333-3333-4333-8333-333333333333","tool_names":["search_documentation","get_document"],"params":{}}],"structured_output":[{"id":"answer","type":"string"},{"id":"sources","type":"string[]"}]}}}}}},"responses":{"202":{"description":"Custom agent run queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomAgentRunResponse"}}}},"400":{"description":"Invalid custom agent payload."},"401":{"description":"Missing or invalid API key."}}}},"/agents/runs/{jobId}":{"get":{"summary":"Get one-off custom agent run","description":"Returns status, result, billing summary, logs, or failure details for a one-off custom agent run. The API key may access only runs owned by its user.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"jobId","in":"path","required":true,"description":"One-off run UUID returned by POST /agents/run.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current one-off custom agent run record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiAgenticJob"}}}},"401":{"description":"Missing or invalid API key."},"404":{"description":"Run not found or does not belong to the API-key owner."}}}},"/agents/discover-mcp":{"post":{"summary":"Discover MCP/OpenAPI tools","description":"Discovers tools and required parameters from a Remote MCP URL or OpenAPI spec before attaching it to a custom agent.","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpDiscoveryRequest"}}}},"responses":{"200":{"description":"Discovered tools and metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpDiscoveryResponse"}}}},"400":{"description":"Invalid discovery payload."},"401":{"description":"Missing or invalid API key."}}}},"/agents/{id}":{"patch":{"summary":"Update custom agent","description":"Updates a scheduled custom agent configuration by ID.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomAgentRequest"}}}},"responses":{"200":{"description":"Updated custom agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomAgentResponse"}}}},"400":{"description":"Invalid custom agent payload."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Agent not found."}}}},"/mcp-market/mcps":{"get":{"summary":"List approved MCP Market integrations","description":"Returns the public catalog of approved MCP and OpenAPI integrations. Only consumer-safe listing fields are returned; provider secrets, source configuration, review metadata, and unapproved submissions are excluded. Authentication is still required so catalog access follows the same account controls and rate-limiting boundary as the rest of the public API.","security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"Approved MCP and OpenAPI catalog entries.","content":{"application/json":{"schema":{"type":"object","properties":{"mcps":{"type":"array","items":{"$ref":"#/components/schemas/McpMarketPublicEntry"}}},"required":["mcps"]}}}},"401":{"description":"Missing or invalid API key."},"502":{"description":"The market service returned an invalid response."},"504":{"description":"The market service did not respond before the timeout."}}}},"/mcp-market/mcps/{mcpId}":{"get":{"summary":"Get an approved MCP Market integration","description":"Returns one approved public MCP or OpenAPI listing by UUID. Pending, rejected, disabled, or nonexistent entries are reported as not found so private review state is not disclosed to consumers. Use the submission endpoints instead when reading an entry owned by the API key holder.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"mcpId","in":"path","required":true,"description":"Approved MCP Market entry UUID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Approved public MCP listing.","content":{"application/json":{"schema":{"type":"object","properties":{"mcp":{"$ref":"#/components/schemas/McpMarketPublicEntry"}},"required":["mcp"]}}}},"400":{"description":"mcpId is not a valid UUID."},"401":{"description":"Missing or invalid API key."},"404":{"description":"No approved MCP listing exists with this ID."}}}},"/mcp-market/submissions":{"get":{"summary":"List my MCP Market submissions","description":"Returns every MCP and OpenAPI submission owned by the authenticated account, including pending, approved, rejected, disabled, and revision entries. This owner-only response may contain source configuration and decrypted provider-owned configuration, so it must never be exposed to browser clients or other users.","security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"Owner-scoped MCP submissions.","content":{"application/json":{"schema":{"type":"object","properties":{"submissions":{"type":"array","items":{"$ref":"#/components/schemas/McpMarketSubmission"}}},"required":["submissions"]}}}},"401":{"description":"Missing or invalid API key."}}},"post":{"summary":"Create an MCP Market submission","description":"Creates a pending-review MCP or OpenAPI submission for the authenticated account. The source must first pass discovery and validation, and validationId plus sourceFingerprint must belong to the caller and match the exact submitted source. Provider-event pricing additionally requires a completed, unexpired event verification for the same source and event set. Remote destinations are subject to HTTPS and SSRF protections. Successful creation does not publish the entry; an administrator must approve it.","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpMarketSubmissionRequest"}}}},"responses":{"201":{"description":"Pending-review submission created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketIdResponse"}}}},"400":{"description":"Malformed payload, unsafe source URL, missing source data, or invalid tool/pricing configuration."},"401":{"description":"Missing or invalid API key, or remote discovery requires additional credentials."},"409":{"description":"Validation or event verification does not match the submitted source, has expired, or is incomplete."},"413":{"description":"Request body exceeds the 2 MiB public API limit."},"422":{"description":"The MCP or OpenAPI contract failed validation."}}}},"/mcp-market/submissions/{submissionId}":{"get":{"summary":"Get my MCP Market submission","description":"Returns the private owner view of one MCP or OpenAPI submission. Ownership is checked using the authenticated API key; a submission owned by another account is returned as not found to avoid identifier enumeration. The response may include sensitive provider configuration and should be handled as confidential server-side data.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"submissionId","in":"path","required":true,"description":"Owner-scoped MCP submission UUID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Private owner view of the submission.","content":{"application/json":{"schema":{"type":"object","properties":{"submission":{"$ref":"#/components/schemas/McpMarketSubmission"}},"required":["submission"]}}}},"400":{"description":"submissionId is not a valid UUID."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Submission not found or not owned by the authenticated account."}}},"put":{"summary":"Replace my editable MCP Market submission","description":"Replaces the editable configuration of an owner-scoped submission and returns it to pending review. The endpoint intentionally requires the complete submission payload and repeats validation and event-verification gates so a source or pricing configuration cannot be changed after approval checks. Approved entries are immutable; create a revision instead. Ownership failures are returned as not found.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"submissionId","in":"path","required":true,"description":"MCP submission UUID to replace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpMarketSubmissionRequest"}}}},"responses":{"204":{"description":"Submission replaced and queued for review."},"400":{"description":"Invalid UUID or invalid full submission payload."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Submission not found or not owned by the authenticated account."},"409":{"description":"Approved submissions cannot be edited, or validation verification does not match."},"413":{"description":"Request body exceeds the 2 MiB limit."},"422":{"description":"The submitted contract failed validation."}}},"delete":{"summary":"Delete my unapproved MCP Market submission","description":"Permanently deletes an MCP or OpenAPI submission owned by the authenticated account only when it is not approved. Before deletion, the service removes the MCP from saved automation and Agent Market selections so later runs cannot retain a missing dependency. Historical tool-call and provider-event billing records are preserved for audit purposes but detached from the deleted MCP identifier. Approved marketplace entries cannot be deleted through this operation because consumers may depend on them; use a revision or contact an administrator for deactivation. Repeating a successful delete returns not found.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"submissionId","in":"path","required":true,"description":"MCP submission UUID to delete.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Unapproved submission permanently deleted, dependent selections removed, and historical usage retained."},"400":{"description":"submissionId is not a valid UUID."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Submission not found or not owned by the authenticated account."},"409":{"description":"Approved MCP entries cannot be deleted by their provider."}}}},"/mcp-market/submissions/{submissionId}/revisions":{"post":{"summary":"Create a revision of an approved MCP listing","description":"Creates a new pending-review child submission for an approved MCP or OpenAPI listing owned by the authenticated account. The approved parent remains unchanged and available to consumers while the revision is reviewed. The full replacement payload must pass the same source validation, fingerprint, SSRF, tool, pricing, and event-verification gates as a new submission.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"submissionId","in":"path","required":true,"description":"Approved parent MCP listing UUID.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpMarketSubmissionRequest"}}}},"responses":{"201":{"description":"Pending-review revision created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketIdResponse"}}}},"400":{"description":"Invalid UUID or invalid revision payload."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Parent listing not found or not owned by the authenticated account."},"409":{"description":"The parent is not approved or verification requirements are not satisfied."}}}},"/mcp-market/discover":{"post":{"summary":"Discover MCP or OpenAPI tools","description":"Connects to a remote MCP source or parses an OpenAPI document and returns normalized tools, required parameters, source metadata, and the resolved OpenAPI document when applicable. This is a preparatory operation and does not create a market submission. Remote requests enforce HTTPS, block loopback and private-network destinations, validate redirects, and use a bounded timeout.","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpMarketDiscoveryRequest"}}}},"responses":{"200":{"description":"Normalized discovery result.","content":{"application/json":{"schema":{"type":"object","properties":{"discovery":{"type":"object","additionalProperties":true}},"required":["discovery"]}}}},"400":{"description":"Invalid source, unsafe destination, missing source data, or no tools discovered."},"401":{"description":"Missing or invalid API key."},"413":{"description":"Request body exceeds the 2 MiB limit."},"504":{"description":"Discovery did not complete before the timeout."}}}},"/mcp-market/validations":{"post":{"summary":"Validate an MCP or OpenAPI submission source","description":"Performs discovery and contract validation, then sends a real side-effect-free GET request to an OpenAPI operation that has no required inputs. OpenAPI validation succeeds only when that live request returns a 2xx or 3xx response. Temporary credentials from params are used for the probe but are not persisted as consumer configuration. The resolved API base URL is protected by HTTPS and private-network checks and is bound into the SHA-256 source fingerprint, preventing a provider from replacing the tested destination during submission. The returned validationId and sourceFingerprint are mandatory gates for create, update, and revision operations.","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpMarketDiscoveryRequest"}}}},"responses":{"201":{"description":"The contract is valid and the live OpenAPI request, when applicable, succeeded. Validation evidence was recorded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpMarketValidationResponse"}}}},"400":{"description":"Malformed validation request or missing source data."},"401":{"description":"Missing/invalid API key or the remote source requires additional parameters."},"413":{"description":"Request body exceeds the 2 MiB limit."},"422":{"description":"Source was reachable but failed contract validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpMarketValidationResponse"}}}}}}},"/mcp-market/event-verifications":{"post":{"summary":"Start provider event verification","description":"Creates a short-lived verification session for provider_event monetization. The source fingerprint and complete unique event-name set are bound to the authenticated account. The returned chargeToken is secret and must be sent only by the provider while proving each declared event; a submission cannot use provider-event pricing until every event is verified before expiration.","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketEventVerificationRequest"}}}},"responses":{"201":{"description":"Verification session and short-lived secret token created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketEventVerification"}}}},"400":{"description":"Invalid fingerprint or empty/invalid event-name list."},"401":{"description":"Missing or invalid API key."}}}},"/mcp-market/event-verifications/{verificationId}":{"get":{"summary":"Get provider event verification status","description":"Returns the event names proved so far, completion state, and expiration time for a verification owned by the authenticated account. The creation-time charge token is not returned again. Another account cannot inspect the session and receives not found.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"verificationId","in":"path","required":true,"description":"Owner-scoped event verification UUID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current verification state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketEventVerification"}}}},"400":{"description":"verificationId is not a valid UUID."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Verification not found or not owned by the authenticated account."}}}},"/provider/runs/{runId}/charge":{"post":{"summary":"Report a provider-defined billable event","operationId":"chargeProviderEvent","description":"Reports event-driven usage from a provider MCP or API during an Agentic Scraper marketplace run. Call this endpoint only from the provider server after reading the short-lived x-agentic-charge-token forwarded with the tool request. Authentication uses the provider account API key in X-API-Key. The charge token binds the request to the buyer, provider, marketplace entry, run budget, and expiry; the provider API key must own that marketplace entry. The idempotency-key header is mandatory and must remain stable across retries for the same logical event. Verification tokens exercise the same contract without debiting a wallet. For production tokens, the response chargedCount is authoritative and may be lower than count when the buyer run charge limit is reached. Do not return or fulfill more billable units than chargedCount.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"runId","in":"path","required":true,"description":"Run UUID embedded in the signed charge token.","schema":{"type":"string","format":"uuid"}},{"name":"x-agentic-charge-token","in":"header","required":true,"description":"Short-lived signed charge context received by the provider with the incoming marketplace tool request. Treat it as a secret and never log it.","schema":{"type":"string","minLength":1}},{"name":"idempotency-key","in":"header","required":true,"description":"Stable unique key for one logical event report. Retries with the same run and key return the original result without charging twice.","schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderEventChargeRequest"}}}},"responses":{"200":{"description":"Verification completed or an existing idempotent charge replayed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderEventChargeResult"}}}},"201":{"description":"Provider event charge accepted and recorded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderEventChargeResult"}}}},"400":{"description":"Invalid run UUID, headers, payload, event count, or charge token/run mismatch."},"401":{"description":"Missing or invalid API key or charge token."},"402":{"description":"The buyer wallet does not have enough balance for any requested unit."},"403":{"description":"The provider API key does not own the marketplace entry bound to the charge token."},"404":{"description":"The run, marketplace entry, or configured pricing event was not found."},"409":{"description":"The idempotency key conflicts with a different event payload."},"422":{"description":"The event is not enabled for provider-event charging."},"502":{"description":"The internal market billing service returned an invalid response."},"504":{"description":"The internal market billing service did not respond before the timeout."}},"x-codeSamples":[{"lang":"TypeScript","label":"Provider SDK","source":"import { AgenticProviderClient } from 'agentic-scraper-provider-sdk';\n\nconst provider = new AgenticProviderClient({\n  apiKey: process.env.AGENTIC_PROVIDER_API_KEY!\n});\n\nconst result = await provider.charge({\n  chargeToken,\n  eventName: 'record-returned',\n  count: records.length,\n  idempotencyKey: `records:${requestId}`\n});\n\nconst billableRecords = records.slice(0, result.chargedCount);"},{"lang":"Python","label":"Provider SDK","source":"from agentic_scraper_provider import AgenticProviderClient\n\nprovider = AgenticProviderClient(api_key=os.environ['AGENTIC_PROVIDER_API_KEY'])\nresult = provider.charge(\n    charge_token=charge_token,\n    event_name='record-returned',\n    count=len(records),\n    idempotency_key=f'records:{request_id}',\n)\nbillable_records = records[:result['chargedCount']]"},{"lang":"Shell","label":"cURL","source":"curl --request POST \\\n  --url \"https://api.agenticscraper.com/api/v1/provider/runs/${RUN_ID}/charge\" \\\n  --header \"Content-Type: application/json\" \\\n  --header \"X-API-Key: ${AGENTIC_PROVIDER_API_KEY}\" \\\n  --header \"x-agentic-charge-token: ${CHARGE_TOKEN}\" \\\n  --header \"idempotency-key: records-${REQUEST_ID}\" \\\n  --data '{\"eventName\":\"record-returned\",\"count\":25}'"}]}},"/mcp-market/icons":{"post":{"summary":"Upload an MCP or agent market icon","description":"Uploads a PNG icon for the authenticated provider and returns a public iconUrl plus an owner-bound storage object key. Only PNG payloads are accepted. The request is subject to the 2 MiB API body limit; callers should resize and optimize images before base64 encoding. Use both returned values in a subsequent MCP or Agent Market submission.","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketIconUploadRequest"}}}},"responses":{"201":{"description":"Icon stored for the authenticated provider.","content":{"application/json":{"schema":{"type":"object","properties":{"iconUrl":{"type":"string","format":"uri"},"objectKey":{"type":"string"}},"required":["iconUrl","objectKey"]}}}},"400":{"description":"Invalid file name, media type, or base64 payload."},"401":{"description":"Missing or invalid API key."},"413":{"description":"Encoded image exceeds the 2 MiB request limit."}}}},"/agent-market/agents":{"get":{"summary":"List approved Agent Market agents","description":"Returns approved public Agent Market listings. The response intentionally excludes system prompts, prompt templates, provider identity, private tool configuration, and review metadata. Authentication is required so catalog usage remains account-scoped and consistent with purchase and execution operations.","security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"Approved public agent listings.","content":{"application/json":{"schema":{"type":"object","properties":{"agents":{"type":"array","items":{"$ref":"#/components/schemas/AgentMarketPublicEntry"}}},"required":["agents"]}}}},"401":{"description":"Missing or invalid API key."}}}},"/agent-market/agents/{agentId}":{"get":{"summary":"Get an approved Agent Market agent","description":"Returns one approved public Agent Market listing. Unapproved, disabled, rejected, and nonexistent entries are reported as not found so private review state is not disclosed. Private prompts and tool configuration are never included in this public catalog response.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"agentId","in":"path","required":true,"description":"Approved Agent Market entry UUID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Approved public agent listing.","content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"$ref":"#/components/schemas/AgentMarketPublicEntry"}},"required":["agent"]}}}},"400":{"description":"agentId is not a valid UUID."},"401":{"description":"Missing or invalid API key."},"404":{"description":"No approved agent listing exists with this ID."}}}},"/agent-market/agents/{agentId}/purchase":{"post":{"summary":"Purchase an Agent Market agent","description":"Purchases access to an approved Agent Market agent for the API key owner. The operation is idempotent: provide a stable idempotencyKey for retries, or the platform derives an account-and-agent key. Paid purchases verify wallet balance, apply platform commission, emit one metering event, and persist access without double charging. Providers automatically retain access to their own agents.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"agentId","in":"path","required":true,"description":"Approved Agent Market entry UUID.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"idempotencyKey":{"type":"string","description":"Stable caller-generated key used to make purchase retries safe."}}}}}},"responses":{"200":{"description":"The account already owned the agent; existing purchase returned.","content":{"application/json":{"schema":{"type":"object","properties":{"purchase":{"type":"object","additionalProperties":true}},"required":["purchase"]}}}},"201":{"description":"Agent access purchased.","content":{"application/json":{"schema":{"type":"object","properties":{"purchase":{"type":"object","additionalProperties":true}},"required":["purchase"]}}}},"400":{"description":"Invalid agentId or purchase payload."},"401":{"description":"Missing or invalid API key."},"402":{"description":"Insufficient wallet balance."},"404":{"description":"Approved agent listing not found."}}}},"/agent-market/submissions":{"get":{"summary":"List my Agent Market submissions","description":"Returns every Agent Market submission owned by the authenticated account, including pending, approved, rejected, disabled, and revision records. This private view contains decrypted system prompts, templates, skills, and tool selections and must be kept on a trusted server.","security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"Owner-scoped agent submissions.","content":{"application/json":{"schema":{"type":"object","properties":{"submissions":{"type":"array","items":{"$ref":"#/components/schemas/AgentMarketSubmission"}}},"required":["submissions"]}}}},"401":{"description":"Missing or invalid API key."}}},"post":{"summary":"Create an Agent Market submission","description":"Creates a pending-review Agent Market submission owned by the authenticated account. System prompts and prompt templates are encrypted at rest. Template-mode agents must include a promptTemplate; task-mode agents receive the task at run time. Creation does not publish or grant consumer access until administrative approval.","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentMarketSubmissionRequest"}}}},"responses":{"201":{"description":"Pending-review agent submission created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketIdResponse"}}}},"400":{"description":"Invalid agent configuration or missing template requirements."},"401":{"description":"Missing or invalid API key."},"413":{"description":"Request body exceeds the 2 MiB limit."}}}},"/agent-market/submissions/{submissionId}":{"get":{"summary":"Get my Agent Market submission","description":"Returns one private Agent Market submission only when it belongs to the API key owner. Ownership failures are returned as not found. The response can contain decrypted system prompts and private tool selections, so callers must not expose it to untrusted clients.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"submissionId","in":"path","required":true,"description":"Owner-scoped agent submission UUID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Private owner view of the agent submission.","content":{"application/json":{"schema":{"type":"object","properties":{"submission":{"$ref":"#/components/schemas/AgentMarketSubmission"}},"required":["submission"]}}}},"400":{"description":"submissionId is not a valid UUID."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Submission not found or not owned by the authenticated account."}}},"put":{"summary":"Replace my editable Agent Market submission","description":"Replaces an unapproved owner-scoped agent submission with a complete new configuration and returns it to pending review. Prompts are re-encrypted at rest. Approved agents are immutable because purchased consumers may depend on them; create a revision instead. A submission owned by another account is reported as not found.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"submissionId","in":"path","required":true,"description":"Agent submission UUID to replace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentMarketSubmissionRequest"}}}},"responses":{"204":{"description":"Agent submission replaced and queued for review."},"400":{"description":"Invalid UUID or invalid full agent payload."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Submission not found or not owned by the authenticated account."},"409":{"description":"Approved agents cannot be edited directly."},"413":{"description":"Request body exceeds the 2 MiB limit."}}},"delete":{"summary":"Delete my unapproved Agent Market submission","description":"Permanently deletes an Agent Market submission owned by the authenticated account only when it is not approved. Approved agents cannot be deleted through the provider CRUD API because consumers may have purchased access; use a revision or request administrative deactivation. The operation is owner-scoped and returns not found for other users’ IDs.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"submissionId","in":"path","required":true,"description":"Agent submission UUID to delete.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Unapproved agent submission permanently deleted."},"400":{"description":"submissionId is not a valid UUID."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Submission not found or not owned by the authenticated account."},"409":{"description":"Approved agents cannot be deleted by their provider."}}}},"/agent-market/submissions/{submissionId}/revisions":{"post":{"summary":"Create a revision of an approved Agent Market listing","description":"Creates a pending-review child revision for an approved agent owned by the authenticated account. The approved parent remains unchanged and available to purchasers while the revision is reviewed. The complete agent configuration is required and prompt material is encrypted independently for the new revision.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"submissionId","in":"path","required":true,"description":"Approved parent Agent Market listing UUID.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentMarketSubmissionRequest"}}}},"responses":{"201":{"description":"Pending-review agent revision created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketIdResponse"}}}},"400":{"description":"Invalid UUID or invalid revision payload."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Parent agent not found or not owned by the authenticated account."},"409":{"description":"Only an approved parent can receive a revision."}}}},"/agent-market/agents/{agentId}/run":{"post":{"summary":"Run an Agent Market agent","description":"Queues a one-off run of an approved Agent Market agent that the API key owner can access. The platform resolves the listing prompt, skills, structured output, MCP tools, and recommended LLM configuration before execution.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"agentId","in":"path","required":true,"description":"UUID of the approved Agent Market listing.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketAgentRunRequest"},"examples":{"taskMode":{"summary":"Run a task-mode Agent Market agent","value":{"task":"Research the requested topic and return a source-backed summary.","llm_provider":"agentic_scraper","llm_model":"google/gemini-2.5-flash","webhook_url":"https://example.com/webhooks/agentic-scraper","headless":true}},"templateMode":{"summary":"Run a template-mode Agent Market agent","value":{"inputs":{"topic":"browser agents","maximumResults":10}}}}}}},"responses":{"202":{"description":"Market agent run accepted and queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketAgentRunResponse"}}}},"400":{"description":"Invalid inputs, runtime configuration, or request body."},"401":{"description":"Missing or invalid API key."},"402":{"description":"The wallet balance is insufficient for this agent or one of its paid tools."},"403":{"description":"The API key owner has not purchased or cannot access this agent."},"404":{"description":"Agent Market listing not found."}}}},"/agent-market/runs/{jobId}":{"get":{"summary":"Get an Agent Market run","description":"Returns the current status, logs, result, and error details for an Agent Market run created by the authenticated API key owner.","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"jobId","in":"path","required":true,"description":"Market agent run UUID returned by the run endpoint.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current Agent Market run record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiAgenticJob"}}}},"401":{"description":"Missing or invalid API key."},"404":{"description":"Run not found or it belongs to another user."}}}}}}