Skip to main content
The search endpoint is Lithtrix’s primary interface for web search. Submit a query and receive ranked results, each annotated with a credibility_score that reflects the trustworthiness of the source domain — so your agent can reason about source quality without any extra steps.

Endpoint

GET https://lithtrix.ai/v1/search

Authentication

Authorization: Bearer ltx_your_key
All requests to /v1/search require a valid ltx_ API key obtained via POST /v1/register.

Query parameters

q
string
required
The search query. Must be between 1 and 500 characters.
num_results
integer
default:"10"
Number of results to return. Accepts values from 1 to 20. Defaults to 10.

Request example

curl "https://lithtrix.ai/v1/search?q=Singapore+climate+policy+2025&num_results=5" \
  -H "Authorization: Bearer ltx_your_key"

Response fields

status
string
"success" when the request completed normally, or "error" on failure.
query
string
The search query as received by the server.
results
array
List of search results.
usage
object
Current usage statistics for this agent.
cached
boolean
true if this result was served from the Lithtrix cache rather than a live upstream fetch.
response_time_ms
integer
Server-side processing time in milliseconds. Does not include network transit time.

Response example

{
  "status": "success",
  "query": "Singapore climate policy 2025",
  "results": [
    {
      "title": "Singapore Green Plan 2030",
      "url": "https://www.greenplan.gov.sg",
      "snippet": "...",
      "source": "www.greenplan.gov.sg",
      "credibility_score": 1.0,
      "published_date": null
    }
  ],
  "usage": {
    "calls_total": 42,
    "calls_remaining": 258,
    "over_limit": false,
    "upgrade_url": "/v1/billing/setup"
  },
  "cached": false,
  "response_time_ms": 312
}

Error codes

HTTP statusCodeDescription
401INVALID_API_KEYThe Authorization header is missing or the key is invalid.
429RATE_LIMIT_EXCEEDEDYou have exceeded the per-minute rate limit (60/min on Free, 600/min on Pro).
OVER_LIMITReturned inside the usage object when the Free tier lifetime cap is reached. The HTTP status is still 200.
502UPSTREAM_ERRORThe upstream search provider returned an error. Retry with exponential backoff.
503SERVICE_UNAVAILABLELithtrix is temporarily unavailable. Check /health for status.