Search the web

Run up to three web searches and get the top pages.

POSThttps://inference.trymorse.ai/v1/search

Runs up to three web searches and returns the top pages with excerpts. Each call costs 1,000 micros, a tenth of a credit. A failed call costs nothing.

Web search is not offered to API keys for now: GET /v1/models lists no such model to a key, and a key's request here gets 404 model_not_found. A Morse app login can still use it.

curl -X POST https://inference.trymorse.ai/v1/search \
  -H "Authorization: Bearer $MORSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "parallel-search",
    "queries": [
      "go 1.27 release notes"
    ],
    "objective": "What changed in the standard library?"
  }'
Response
{
  "object": "search.results",
  "results": [
    {
      "url": "https://go.dev/doc/go1.27",
      "title": "Go 1.27 Release Notes",
      "published": null,
      "excerpts": [
        "## Standard library\n..."
      ]
    }
  ]
}

Request body

modelstringRequired

A search model's id, such as parallel-search.

queriesarray of stringRequired
objectivestring

What you want to learn. The search uses it to choose the excerpts.

Response

The result.

object"search.results"Required
resultsarray of objectRequired
Show 4 fields
urlstringRequired
titlestringRequired

Empty when the page has none.

publishedstring | nullRequired

YYYY-MM-DD, or null when unknown.

excerptsarray of stringRequired

The excerpts of all results together hold at most 8,000 characters.

Response headers

HeaderWhat it says
X-Morse-VersionThe running build. Every reply carries it.
X-FundingWhat pays for the request. With a key, the value is always credits. A request that Morse refuses before it bills anything has no X-Funding.
X-Request-IdAn id for this request. Quote it when you contact support about the request. An error that arrives after the request starts carries it too. A request that Morse refuses before it bills anything has no X-Request-Id.

Errors

Every error has the same shape. Errors explains it and when to retry.

400The request is malformed.5 codes
invalid_request_body
The body is not a JSON object, a field has the wrong JSON type, or model is missing.
invalid_parameter
A field has a value the endpoint refuses. The message names the field.
duplicate_json_key
A JSON object in the body repeats a key.
invalid_parameter
queries, a query, or objective is out of range. The message names it.
privacy_floor_unmet
The model's tier is below the API key's min_privacy. param is key.min_privacy, and the message names both tiers. GET /v1/models lists only the models the key may call. Morse refuses before it calls the model or holds any credit.
401The key is missing or wrong.3 codes
invalid_api_key
The Authorization header is missing or not Bearer, the key is unknown or revoked, a token that starts with sk_ is not a whole sk_morse_ key, or the bearer is no Morse key or login token at all, such as another service's API key (sk-proj-...).
api_key_expired
The key is past the expiry set on it. Make a new key, or set a later expiry before a key expires.
invalid_token
The bearer is shaped as a Morse login token (a JWT) but its signature fails or it has expired. An API key sends the whole sk_morse_ key.
402The account's credits, or what the key's spend limit has left, do not cover the request.2 codes
insufficient_balance
The balance is below the amount the request must hold. While the balance is negative, the API refuses every metered request.
key_spend_limit_reached
What the key's spend limit has left in its window is below the amount the request must hold. A limit that resets daily, weekly, or monthly sends Retry-After, the seconds until it resets. A limit that never resets sends none. Raise or remove the limit in the dashboard, and the next request is served.
403The key's account may not make this request.5 codes
account_disabled
Morse has disabled the key's account.
account_deleted
The key's account has been deleted.
account_under_18
The account's owner said they are under 18.
ip_not_allowed
The key allows requests only from its allowed IPs, and the request came from another address. The message names the address the proxy saw.
sealed_required
The key is sealed_only, and the request came unsealed. Send it inside POST /v1/sealed, as the Morse app does.
404The model does not exist, or it is not a model for this endpoint.1 code
model_not_found
No model of this endpoint's type has that name.
408The request body arrived too slowly.1 code
request_timeout
The request body did not arrive within one minute.
413The request body is too large.1 code
request_too_large
The body is over 64 KiB.
429The account is over its rate limit or its concurrency limit. Search and fetch each also allow 30 calls a minute per account. Wait the number of seconds in Retry-After, then retry.2 codes
rate_limit_exceeded
The account used up its requests per minute. All of the account's keys and its owner's use of the Morse app share one budget.
concurrency_limit_exceeded
The account already has its maximum number of requests in flight. Retry-After is 1.
502The web provider failed.2 codes
upstream_error
The provider failed or did not answer in time.
upstream_unavailable
The provider is unavailable right now. Retry later, or choose another model.
503Morse or the provider is busy or unavailable. Retry the request later.3 codes
service_unavailable
Morse could not start the request. Retry it.
server_busy
Morse is busy. Retry-After is 1.
upstream_busy
The web provider is busy for every Morse account. Retry-After says when to retry.