Search the web
curl --request POST \
--url https://api.trymorse.ai/v1/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "parallel-search",
"queries": [
"go 1.27 release notes"
],
"objective": "What changed in the standard library?"
}
'import requests
url = "https://api.trymorse.ai/v1/search"
payload = {
"model": "parallel-search",
"queries": ["go 1.27 release notes"],
"objective": "What changed in the standard library?"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'parallel-search',
queries: ['go 1.27 release notes'],
objective: 'What changed in the standard library?'
})
};
fetch('https://api.trymorse.ai/v1/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"object": "search.results",
"results": [
{
"url": "https://go.dev/doc/go1.27",
"title": "Go 1.27 Release Notes",
"published": null,
"excerpts": [
"## Standard library\n..."
]
}
]
}{
"error": {
"message": "queries must be a list of 1 to 3 strings.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_parameter"
}
}{
"error": {
"message": "Incorrect API key provided.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_api_key"
}
}{
"error": {
"message": "The account balance does not cover this request. Add credit.",
"type": "insufficient_balance",
"param": null,
"code": "insufficient_balance"
}
}{
"error": {
"message": "This account has been disabled. Contact support.",
"type": "invalid_request_error",
"param": null,
"code": "account_disabled"
}
}{
"error": {
"message": "The requested model does not exist.",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}{
"error": {
"message": "The request body did not arrive in time.",
"type": "invalid_request_error",
"param": null,
"code": "request_timeout"
}
}{
"error": {
"message": "Request body is too large.",
"type": "invalid_request_error",
"param": null,
"code": "request_too_large"
}
}{
"error": {
"message": "Rate limit reached for this account. Retry after the time in the Retry-After header.",
"type": "requests",
"param": null,
"code": "rate_limit_exceeded"
}
}{
"error": {
"message": "The web provider failed.",
"type": "upstream_error",
"param": null,
"code": "upstream_error"
}
}{
"error": {
"message": "The web provider is busy. Try again shortly.",
"type": "upstream_error",
"param": null,
"code": "upstream_busy"
}
}API Reference
Search the web
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.
POST
/
v1
/
search
Search the web
curl --request POST \
--url https://api.trymorse.ai/v1/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "parallel-search",
"queries": [
"go 1.27 release notes"
],
"objective": "What changed in the standard library?"
}
'import requests
url = "https://api.trymorse.ai/v1/search"
payload = {
"model": "parallel-search",
"queries": ["go 1.27 release notes"],
"objective": "What changed in the standard library?"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'parallel-search',
queries: ['go 1.27 release notes'],
objective: 'What changed in the standard library?'
})
};
fetch('https://api.trymorse.ai/v1/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"object": "search.results",
"results": [
{
"url": "https://go.dev/doc/go1.27",
"title": "Go 1.27 Release Notes",
"published": null,
"excerpts": [
"## Standard library\n..."
]
}
]
}{
"error": {
"message": "queries must be a list of 1 to 3 strings.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_parameter"
}
}{
"error": {
"message": "Incorrect API key provided.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_api_key"
}
}{
"error": {
"message": "The account balance does not cover this request. Add credit.",
"type": "insufficient_balance",
"param": null,
"code": "insufficient_balance"
}
}{
"error": {
"message": "This account has been disabled. Contact support.",
"type": "invalid_request_error",
"param": null,
"code": "account_disabled"
}
}{
"error": {
"message": "The requested model does not exist.",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}{
"error": {
"message": "The request body did not arrive in time.",
"type": "invalid_request_error",
"param": null,
"code": "request_timeout"
}
}{
"error": {
"message": "Request body is too large.",
"type": "invalid_request_error",
"param": null,
"code": "request_too_large"
}
}{
"error": {
"message": "Rate limit reached for this account. Retry after the time in the Retry-After header.",
"type": "requests",
"param": null,
"code": "rate_limit_exceeded"
}
}{
"error": {
"message": "The web provider failed.",
"type": "upstream_error",
"param": null,
"code": "upstream_error"
}
}{
"error": {
"message": "The web provider is busy. Try again shortly.",
"type": "upstream_error",
"param": null,
"code": "upstream_busy"
}
}Authorizations
An API key from the Morse app. It starts with sk_morse_.
Body
application/json