qwen3-embedding-0.6b
Text Embeddings • QwenThe Qwen3 Embedding model series is the latest proprietary model of the Qwen family, specifically designed for text embedding and ranking tasks.
| Model Info | |
|---|---|
| Unit Pricing | $0.012 per M input tokens |
Usage
Workers - TypeScript
export interface Env { AI: Ai;}
export default { async fetch(request, env): Promise<Response> {
// Can be a string or array of strings] const stories = [ "This is a story about an orange cloud", "This is a story about a llama", "This is a story about a hugging emoji", ];
const embeddings = await env.AI.run( "@cf/qwen/qwen3-embedding-0.6b", { text: stories, } );
return Response.json(embeddings); },} satisfies ExportedHandler<Env>;Python
import osimport requests
ACCOUNT_ID = "your-account-id"AUTH_TOKEN = os.environ.get("CLOUDFLARE_AUTH_TOKEN")
stories = [ 'This is a story about an orange cloud', 'This is a story about a llama', 'This is a story about a hugging emoji']
response = requests.post( f"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/@cf/qwen/qwen3-embedding-0.6b", headers={"Authorization": f"Bearer {AUTH_TOKEN}"}, json={"text": stories})
print(response.json())curl
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/@cf/qwen/qwen3-embedding-0.6b \ -X POST \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "text": ["This is a story about an orange cloud", "This is a story about a llama", "This is a story about a hugging emoji"] }'Parameters
* indicates a required field
Input
-
queriesone of-
0string min 1A single query string
-
1arrayAn array of query strings
-
itemsstring min 1
-
-
-
instructionstring default Given a web search query, retrieve relevant passages that answer the queryOptional instruction for the task
-
documentsone of-
0string min 1A single document string
-
1arrayAn array of document strings
-
itemsstring min 1
-
-
-
textone of-
0string min 1Alias for documents: a single text string
-
1arrayAlias for documents: an array of text strings
-
itemsstring min 1
-
-
Output
-
dataarray-
itemsarray-
itemsnumber
-
-
-
shapearray-
itemsinteger
-
API Schemas
The following schemas are based on JSON Schema
{ "type": "object", "properties": { "queries": { "oneOf": [ { "type": "string", "description": "A single query string", "minLength": 1 }, { "type": "array", "description": "An array of query strings", "items": { "type": "string", "minLength": 1 }, "maxItems": 32 } ] }, "instruction": { "type": "string", "default": "Given a web search query, retrieve relevant passages that answer the query", "description": "Optional instruction for the task" }, "documents": { "oneOf": [ { "type": "string", "description": "A single document string", "minLength": 1 }, { "type": "array", "description": "An array of document strings", "items": { "type": "string", "minLength": 1 }, "maxItems": 32 } ] }, "text": { "oneOf": [ { "type": "string", "description": "Alias for documents: a single text string", "minLength": 1 }, { "type": "array", "description": "Alias for documents: an array of text strings", "items": { "type": "string", "minLength": 1 }, "maxItems": 32 } ] } }}{ "type": "object", "properties": { "data": { "items": { "items": { "type": "number" }, "type": "array" }, "type": "array" }, "shape": { "items": { "type": "integer" }, "type": "array" } }}Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-