from openai import OpenAIclient = OpenAI(api_key="sk-...", base_url="https://openp.ai/v1")resp = client.embeddings.create( model="text-embedding-3-small", input=["OpenPAI is an API gateway", "What is RAG?"],)for item in resp.data: print(len(item.embedding), item.embedding[:5])
curl https://openp.ai/v1/embeddings \ -H "Authorization: Bearer $OPENPAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "text-embedding-3-small", "input": "OpenPAI is an API gateway" }'