/v1/embeddings 为输入文本生成向量表示,便于下游做语义检索、RAG、聚类和相似度计算。input 和 model,返回结果里包含向量数组与 token 使用情况。常见做法是先为知识库内容建立向量索引,再对用户问题生成向量后做相似召回。curl --location --request POST 'https://crazyrouter.com/v1/completions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-3.5-turbo-instruct",
"prompt": "你好,",
"max_tokens": 30,
"temperature": 0
}'{
"id": "cmpl-ByvHP6AWeB1L5vWZSPNHsB12sU9db",
"object": "text_completion",
"created": 1753859563,
"model": "gpt-3.5-turbo-instruct",
"choices": [
{
"index": 0,
"logprobs": null,
"finish_reason": "length",
"text": "我是小冰,很高兴认识你。我是一个人工智能助手,可以回"
}
],
"usage": {
"prompt_tokens": 3,
"completion_tokens": 30,
"total_tokens": 33
}
}