> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aihubmix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Embedding

> AiHubMix offers an OpenAI-compatible, high-efficiency vector embedding solution.

## Usage Guide

AiHubMix embedding models efficiently convert text or document content into searchable vector data, widely used in RAG Q\&A systems and intelligent customer support. Whether for plain text or full documents, you can generate embeddings with a single call to significantly improve semantic processing.

<CodeGroup>
  ```py Universal Embedding theme={null}
  from openai import OpenAI
  import os

  client = OpenAI(
      api_key="sk-***", # Replace with the key you generated in the AIHUBMIX dashboard
      base_url="https://aihubmix.com/v1"
  )

  response = client.embeddings.create(
      input="Your text string goes here",
      model="gemini-embedding-001"
  )

  print(response.data[0].embedding)
  ```

  ```py Read Document and Embed theme={null}
  from openai import OpenAI
  import os

  client = OpenAI(
      api_key="sk-***", # Replace with the key you generated in the AIHUBMIX dashboard
      base_url="https://aihubmix.com/v1"
  )

  # Read file
  def read_whimery_file():
      try:
          with open('yourpath/file.md', 'r', encoding='utf-8') as file:
              return file.read()
      except Exception as e:
          print(f"Error reading file: {e}")
          return None

  # Read the content and create embeddings
  content = read_whimery_file()
  if content:
      response = client.embeddings.create(
          input=content,
          model="gemini-embedding-001"
      )
      
      print("File content successfully processed into embeddings")
      print(f"Embedding dimensions: {len(response.data[0].embedding)}")
      print("First 10 embedding values:", response.data[0].embedding)
  else:
      print("Failed to read file content")

  ```
</CodeGroup>

## Available Models

* gemini-embedding-001
* gemini-embedding-exp-03-07
* text-embedding-3-large
* text-embedding-3-small
* text-embedding-ada-002
* jina-embeddings-v4
* jina-embeddings-v3
* jina-embeddings-v2-base-code
* text-embedding-v4
* Qwen/Qwen3-Embedding-0.6B
* doubao-embedding-large-text-240915
* doubao-embedding-text-240715

***

Last updated: 2026-06-01
