API reference
Search from a natural-language question
Builds a typed search request with an optional allowlisted BYOK model or the catalog default, then executes it through the standard search path. A successful build and search are billed as one Agent API run and one Search API request.
POST /v1/search/ask
Request body
JSON body: AskSearchRequest
curl --request POST "https://yep.com/api/v1/search/ask" \
--header "Authorization: Bearer $YEP_API_KEY" \
--header "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"question": "Which independent studies compare carbon border taxes in 2026?"
}
JSON Responses
- Status
- 200
- Description
- Ranked projected search results
- Body
- SearchPostResponse
- Status
- 400
- Description
- The question violated the public contract
- Body
- PublicApiError
- Status
- 401
- Description
- A valid API key is required
- Body
- PublicApiError
- Status
- 402
- Description
- Billing or a spend limit rejected a stage
- Body
- PublicApiError
- Status
- 403
- Description
- The API key lacks agent or search permission
- Body
- PublicApiError
- Status
- 409
- Description
- No stored provider key can run the selected model
- Body
- PublicApiError
- Status
- 429
- Description
- A rate limit rejected a stage
- Body
- PublicApiError
- Status
- 500
- Description
- The service could not safely complete the operation
- Body
- PublicApiError
- Status
- 502
- Description
- The model or search service returned an invalid response
- Body
- PublicApiError
- Status
- 503
- Description
- Inference or search is temporarily unavailable
- Body
- PublicApiError
Schemas
AgentModelRef
One allowlisted inference provider and model identifier.
- Field
- model
- Required
- Yes
- Type
- string
- Description
- Provider-native model identifier.
- Constraints
- Field
- provider
- Required
- Yes
- Type
- ProviderKeyProvider
- Description
- Closed provider discriminator.
- Constraints
AskSearchRequest
Natural-language search request compiled by the query builder before execution.
- Field
- model
- Required
- No
- Type
- null | AgentModelRef
- Description
- Constraints
- Field
- question
- Required
- Yes
- Type
- string
- Description
- Question or search goal to turn into a typed search request.
- Constraints
- min length: 1; max length: 4096
ErrorCode
Machine-readable product API failure.
[
"unauthenticated",
"forbidden",
"invalid_request",
"not_found",
"conflict",
"payment_required",
"too_many_requests",
"upstream",
"internal"
] ErrorRecovery
Browser-safe recovery action selected by the authoritative product boundary.
- Variant
- 1
- Type
- object
- Variant
- 2
- Type
- object
- Variant
- 3
- Type
- object
PageResultFields
Optional nullable projected fields. Each property is omitted when not selected, `null` when selected but unavailable, or carries its typed value.
- Field
- anchor
- Required
- No
- Type
- null | string
- Description
- Aggregated inbound anchor text.
- Constraints
- Field
- author
- Required
- No
- Type
- null | string
- Description
- Page author.
- Constraints
- Field
- categories
- Required
- No
- Type
- null | object[]
- Description
- Scored taxonomy categories.
- Constraints
- Field
- content_angle
- Required
- No
- Type
- null | string
- Description
- Classified content angle.
- Constraints
- Field
- description
- Required
- No
- Type
- null | string
- Description
- Result description.
- Constraints
- Field
- document_intent
- Required
- No
- Type
- null | string
- Description
- Classified document intent.
- Constraints
- Field
- domain
- Required
- No
- Type
- null | string
- Description
- Registrable or host domain.
- Constraints
- Field
- domain_rating
- Required
- No
- Type
- null | number
- Description
- Domain rating.
- Constraints
- Field
- domain_refdomains
- Required
- No
- Type
- null | integer
- Description
- Domain referring-domain count.
- Constraints
- Field
- domain_traffic
- Required
- No
- Type
- null | integer
- Description
- Estimated domain traffic.
- Constraints
- Field
- first_seen
- Required
- No
- Type
- null | string
- Description
- First-seen timestamp.
- Constraints
- Field
- highlights
- Required
- No
- Type
- null | string[]
- Description
- Up to three query-relevant passages.
- Constraints
- Field
- language
- Required
- No
- Type
- null | string
- Description
- Document language.
- Constraints
- Field
- location
- Required
- No
- Type
- null | string
- Description
- Geographic location code.
- Constraints
- Field
- page_type
- Required
- No
- Type
- null | string
- Description
- Page content type.
- Constraints
- Field
- publish_time
- Required
- No
- Type
- null | string
- Description
- Published timestamp.
- Constraints
- Field
- refclass_c
- Required
- No
- Type
- null | integer
- Description
- Refclass-C metric.
- Constraints
- Field
- refdomains
- Required
- No
- Type
- null | integer
- Description
- Referring-domain count.
- Constraints
- Field
- republished
- Required
- No
- Type
- null | boolean
- Description
- Whether the document was republished.
- Constraints
- Field
- rule_type
- Required
- No
- Type
- null | string
- Description
- Applied rule type.
- Constraints
- Field
- site_name
- Required
- No
- Type
- null | string
- Description
- Site display name.
- Constraints
- Field
- title
- Required
- No
- Type
- null | string
- Description
- Page title.
- Constraints
- Field
- traffic
- Required
- No
- Type
- null | integer
- Description
- Estimated URL traffic.
- Constraints
- Field
- url
- Required
- No
- Type
- null | string
- Description
- Canonical page URL.
- Constraints
- Field
- url_rating
- Required
- No
- Type
- null | number
- Description
- URL rating.
- Constraints
- Field
- word_count
- Required
- No
- Type
- null | integer
- Description
- Visible word count.
- Constraints
ProjectedPageResult
One ranked projected result.
- Field
- fields
- Required
- Yes
- Type
- PageResultFields
- Description
- Exactly the requested fields.
- Constraints
- Field
- rank
- Required
- Yes
- Type
- integer
- Description
- One-based result rank.
- Constraints
- min: 1
ProviderKeyProvider
Closed provider set exposed to product clients.
[
"openrouter"
] PublicApiError
Stable public error envelope for APIs whose reason vocabulary is extensible.
- Field
- agent_session_id
- Required
- No
- Type
- string | null
- Description
- Agent execution correlation id, present after an invocation is admitted.
- Constraints
- Field
- code
- Required
- Yes
- Type
- ErrorCode
- Description
- Closed status category suitable for program control flow.
- Constraints
- Field
- message
- Required
- Yes
- Type
- string
- Description
- Safe diagnostic intended for operators, not program branching.
- Constraints
- Field
- reason
- Required
- Yes
- Type
- string
- Description
- Extensible machine-readable detail; clients must accept unknown values.
- Constraints
- Field
- recovery
- Required
- No
- Type
- null | ErrorRecovery
- Description
- Constraints
- Field
- validation
- Required
- No
- Type
- null | ValidationReport
- Description
- Constraints
SearchPostResponse
Public POST search response.
- Field
- duration_ms
- Required
- Yes
- Type
- integer
- Description
- End-to-end duration in milliseconds.
- Constraints
- min: 0
- Field
- request_id
- Required
- Yes
- Type
- string
- Description
- Public request correlation identifier.
- Constraints
- Field
- results
- Required
- Yes
- Type
- ProjectedPageResult[]
- Description
- Ranked projected results.
- Constraints
- Field
- select
- Required
- Yes
- Type
- SearchResultField[]
- Description
- Echoed normalized projection.
- Constraints
SearchResultField
Public fields that may be selected in a search response.
[
"url",
"title",
"description",
"anchor",
"site_name",
"author",
"language",
"domain",
"categories",
"location",
"page_type",
"publish_time",
"first_seen",
"url_rating",
"domain_rating",
"traffic",
"refdomains",
"domain_traffic",
"domain_refdomains",
"refclass_c",
"word_count",
"rule_type",
"document_intent",
"content_angle",
"republished",
"highlights"
] ValidationIssue
One actionable, privacy-safe contract violation.
- Field
- allowed_values
- Required
- No
- Type
- array | null
- Description
- Constraints
- max items: 16
- Field
- code
- Required
- Yes
- Type
- string
- Description
- Stable, extensible machine-readable category.
- Constraints
- max length: 64
- Field
- path
- Required
- Yes
- Type
- string
- Description
- RFC 6901 pointer to the rejected location; empty means the root value.
- Constraints
- max length: 1024
- Field
- suggestion
- Required
- Yes
- Type
- string
- Description
- Code-owned instruction for correcting the request.
- Constraints
- max length: 512
ValidationReport
Bounded validation feedback shared by model, REST, and MCP boundaries.
- Field
- contract
- Required
- Yes
- Type
- string
- Description
- Stable contract name, normally the published schema component name.
- Constraints
- max length: 128
- Field
- issues
- Required
- Yes
- Type
- ValidationIssue[]
- Description
- At most eight deterministic violations. Correct every issue before retrying.
- Constraints
- max items: 8
- Field
- truncated
- Required
- Yes
- Type
- boolean
- Description
- Whether more violations were omitted; retry after correcting the listed issues.
- Constraints