header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Header Params
Body Params application/json
Example
{"model":"qwen3-rerank","documents":["Text ranking models are widely used in search engines and recommendation systems, where they rank candidate texts based on text relevance.","Quantum computing is a frontier field in computational science.","The development of pre-trained language models has brought new progress to text ranking models."],"query":"What is a text sorting model?","top_n":2,"instruct":"Given a web search query, retrieve relevant passages that answer the query."}
Request Code Samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl--location--request POST 'https://api.302.ai/v1/reranks' \
--header'Authorization: Bearer <token>' \
--header'Content-Type: application/json' \
--data-raw'{
"model": "qwen3-rerank",
"documents": [
"Text ranking models are widely used in search engines and recommendation systems, where they rank candidate texts based on text relevance.",
"Quantum computing is a frontier field in computational science.",
"The development of pre-trained language models has brought new progress to text ranking models."
],
"query": "What is a text sorting model?",
"top_n": 2,
"instruct": "Given a web search query, retrieve relevant passages that answer the query."
}'
Responses
🟢200Create embeddings
application/json
Body
Example
{"object":"list","data":[{"object":"embedding","embedding":[0.0023064255,-0.009327292,
.... (1536 floats total for ada-002)
-0.0028842222],"index":0}],"model":"text-embedding-ada-002","usage":{"prompt_tokens":8,"total_tokens":8}}