Tool Market API

Discover, quote, and run Asale marketplace tools directly or through a managed model conversation.

If you already know the inputs, call the Tool Market REST API without a model. To let a model choose a tool and its arguments, use application-managed function calling or the hosted conversation endpoint below.

Use the same snake_case tool name across REST, hosted conversations, MCP, and model function declarations, for example web_search. Older names such as web.search and google.keyword-ideas are still accepted for compatibility. New integrations should use the names returned by the catalog.

Discover, quote, and run

Send requests to https://gw.asale.ai with Authorization: Bearer $ASALE_API_KEY.

EndpointPurpose
GET /v1/toolsList available tools authorized for the current key, with inputSchema. A tool shown in the public market is not necessarily enabled for your key.
POST /v1/tool-quotesSend tool and input and check the returned max_cost_micros against your budget.
POST /v1/tool-runsSend the same tool and input with max_cost_micros and a unique Idempotency-Key header.
GET /v1/tool-runs/{run_id}Check status and charges. Read result once the status is succeeded; charged_micros is the actual charge.
curl --fail-with-body https://gw.asale.ai/v1/tool-quotes \
  -H "Authorization: Bearer $ASALE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"tool":"web_search","input":{"query":"IANA example domains","limit":3}}'

Amounts are integers in micro-USDT: 1 USDT = 1,000,000 micro-USDT. If submission is uncertain, retry with the same API key, request body, and idempotency key. If you have a run_id, query that run instead. reconciliation_required is not a reason to create a new run. Tools and model tokens are billed separately.

Three common tools

ToolExample inputWhen to use it
Web Search web_search{"query":"IANA example domains","limit":3}Find pages and source URLs for a topic.
Web Extract web_extract{"url":"https://example.com"}Read a known public URL, including a page found by search.
YouTube Transcript youtube_transcript{"video_id":"jNQXAC9IVRw"}Retrieve available captions using a video ID, not the full URL.

Tool pages show REST requests, the full schema, and request and result examples for OpenAI, Anthropic, and Gemini. Restricted tools marked REST-only do not have model examples.

Hosted conversation

On POST /v1/tool-chat/completions, Asale runs the conversation and tool loop. This is a separate, non-streaming endpoint, not a setting on ordinary Chat Completions or an Anthropic or Gemini endpoint. Include an Idempotency-Key header and list the permitted tool names in tools.

{
  "model": "<MODEL_ID>",
  "messages": [{"role":"user","content":"Find IANA's explanation of example domains and cite your sources."}],
  "tools": ["web_search"],
  "max_tool_calls": 2,
  "max_tool_cost_micros": 20000,
  "max_tokens": 1024
}

Adjust the sample cost cap based on the quote and your budget. On success, read response.choices[0].message.content and inspect tool_runs. If the response is tool_pending_or_failed, check pending_run.run_id rather than treating it as a final answer. The hosted conversation does not resume automatically.