API Doc-CometAPI
HomeDashBoardModel_Price
HomeDashBoardModel_Price
Discord_Support
  1. OpenAI Compatiable Endpoint
  • GET START
    • Model New Release Announcement
    • Platform notification
    • Help Center
    • Quick Start
    • About Pricing
    • About Grouping
    • Interface Stability
    • Privacy policy
    • Terms of service
    • Error code description
    • Code example
    • Must see for use
    • Common Misconceptions
    • Confusion about use
    • Best Practices
      • CometAPI Account Balance Query API Usage Instructions
      • Retry Logic Documentation for CometAPI and OpenAI Official API
      • Midjourney Best Practices
      • Runway Best Practices
  • OpenAI Compatiable Endpoint
    • gpt-4o-image generates image
      POST
    • Chat
      POST
    • Recognizing Images
      POST
    • Models
      GET
    • Embeddings
      POST
    • Images
      POST
    • Realtime
      POST
    • Image Editing (gpt-image-1)
      POST
  • Audio
    • Create speech
    • Create transcription
    • Create translation
  • Anthropic Compatiable Endpoint
    • Anthropic Claude
  • Music Generation Endpoint
    • Suno
      • Setting suno Version
      • Generate lyrics
      • Generate music clip
      • Upload clip
      • Submit concatenation
      • Single task query
      • Batch query tasks
    • Udio(Temporarily unavailable)
      • Generate music
      • Task query
  • Image Generation Endpoint
    • Midjourney(images)
      • Quick Tutorial - Complete Process in One Go
      • Task Fetching API
        • List by Condition
        • Fetch Single Task (most recommended)
      • Imagine
      • Action (UPSCALE; VARIATION; REROLL; ZOOM, etc.)
      • Blend (image -> image)
      • Describe (image -> text)
      • Modal (Area Redesign & Zoom)
    • Ideogram(images)
      • Official documentation (updated in real time)
      • Generate 3.0 (text to image)
      • Remix 3.0 (hybrid image)
      • Reframe 3.0(Reconstruction)
      • Replace Background 3.0(Background replacement)
      • Edit 3.0(Editing images)
      • ideogram Text Raw Image
      • ideogram Hybrid image
      • ideogram enlargement HD
      • ideogram describes the image
      • ideogram Edit image
    • Flux(images)
      • Generate image (replicate format)
      • flux fine-tune images(Temporarily unavailable)
      • flux generate image(Temporarily unavailable)
      • flux query
    • Replicate(image)
      • replicate Generate
      • replicate query
    • Recraft(images)
      • Appendix
      • Recraft Generate Image
      • Recraft Vectorize Image
      • Recraft Remove Background
      • Recraft Clarity Upscale
      • Recraft Create style
      • Recraft Generative Upscale
  • Video Generation Ednpoint
    • runway(video)
      • official format
        • runway images raw video
        • runway to get task details
      • Reverse Format
        • generate(text)
        • generate(Reference images)
        • Video to Video Style Redraw
        • Act-one Expression Migration
        • feed-get task
    • kling (video)
      • callback_url
      • Generating images
      • Text Generation Video
      • Image Generation Video
      • Video Extension
      • virtual try-on
      • lip sync
      • Individual queries (videos)
    • MiniMax Conch(video)
      • MiniMax Conch Official Documentation
      • MiniMax Conch Generation
      • MiniMax Conch Query
      • MiniMax Conch Download
    • luma (video)
      • Official api interface format
        • luma generate
        • luma search
    • PIKA(video)
      • pika feed
      • PIKA Reference Video Generation
      • PIKA Reference Image Generation
      • PIKA reference text generation
    • sora
      • Reverse Format
        • Create Video
        • Query Video Task
        • Create Video
  • Software Integration Guide
    • cometapi Site API Call Testing
    • OpenManus
    • Chatbox
    • CherryStudio
    • Cursor
    • ChatHub
    • COZE
    • FastGPT
    • cline
    • dify
    • gptme
    • Immersive Translation
    • Lobe-Chat
    • Zotero
    • LangChain
    • AnythingLLM
    • Eudic Translation
    • OpenAI Translator
    • ChatAll Translation
    • Pot Translation
    • GPT Academic Optimization (gpt_academic)
    • NEXT CHAT (ChatGPT Next Web)
    • Obsidian's Text Generator Plugin
    • Open WebUI
    • avante.nvim
    • librechat
    • Lazy Customer Service
    • utools-ChatGPT Friend
    • IntelliJ Translation Plugin
    • n8n
  1. OpenAI Compatiable Endpoint

Embeddings

POST
https://api.cometapi.com/v1/embeddings
Maintainer:Not configured

Embeddings API#

This API endpoint allows you to generate embeddings for text using a specific model.

Request Body#

model (string, required): The name of the text embedding model to be used.
input (string, required): The input text for which embeddings need to be generated.

Request

Header Params
Authorization
string 
required
Example:
Bearer {{api-key}}
Body Params application/json
model
string 
required
The ID of the model you want to use. You can use the List models API :https://platform.openai.com/docs/api-reference/models/list to see all available models, or see our model overview: https://platform. openai.com/docs/models/overview for their descriptions.
input
string 
required
Enter text for embedding, encoded as a string or as an array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or an array of tokens. Each input must be no longer than 8192 tokens.
Example
{
    "model": "text-embedding-3-large",
    "input": "The food was delicious and the waiter..."
}

Request 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.cometapi.com/v1/embeddings' \
--header 'Authorization: Bearer {{api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "text-embedding-3-large",
    "input": "The food was delicious and the waiter..."
}'

Responses

🟢200Successful Response
application/json
Body
object
string 
required
The type of the top-level object.
data
array [object {3}] 
required
A list containing embedding vector objects. If the input requests more than one text embedding, there will be more than one object in this list.
object
string 
optional
The type of the object within the list,
index
integer 
optional
The index of this embedding vector in the input (if the input is bulk) or output list, starting from 0.
embedding
array[number]
optional
The actual embedding vector.
model
string 
required
The name of the specific model used to generate the embedding vector.
usage
object 
required
The token usage statistics for this request.
prompt_tokens
integer 
required
The number of tokens used by the input text (hints) after it has been split.
total_tokens
integer 
required
The total number of tokens processed for this request.
Example
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        -0.010992265,
        0.0027546093,
        -0.0057185953,
        -0.008060995,
        0.0006436691,
        0.010560427,
        -0.011234357,
        -0.056165244,
        -0.010501539,
        0.03946747,
        -0.0047600437,
        0.009192936,
        -0.061766066,
        0.07291536,
        -0.0010280713,
        -0.0033140373,
        -0.01228124,
        -0.012333584,
        -0.03643151,
        0.003035959,
        -0.02189293,
        -0.015153623,
        0.058363695,
        -0.016239764,
        0.06134731,
        -0.024497049,
        -0.012516788,
        0.024353104,
        0.037426047,
        0.015323741,
        -0.015572377,
        0.016737033,
        0.038917854,
        -0.004387092,
        -0.024575565,
        0.02037495,
        0.019301895,
        -0.011404475,
        0.06537781,
        0.032453354,
        -0.052291777,
        0.003467798,
        0.014682527,
        -0.01981225,
        -0.032715075,
        -0.057840254,
        0.0075898976,
        0.0053979876,
        -0.041979987,
        -0.009127506,
        0.0129748,
        -0.015075107,
        0.031720538,
        0.013962795,
        -0.009984641,
        0.01961596,
        -0.029495914,
        -0.014499322,
        -0.013321579,
        -0.032872107,
        -0.01000427,
        -0.03972919,
        0.004910533,
        -0.008532092,
        0.023083758,
        0.022036875,
        0.009487372,
        0.05689806,
        -0.011208185,
        0.006356539,
        0.032034602,
        -0.015729409,
        -0.026564643,
        0.004616097,
        0.038472928,
        0.009605146,
        0.027218943,
        -0.027742384,
        0.0059443293,
        0.0050086784,
        0.034835014,
        -0.0026319278,
        -0.029050987,
        -0.0055255764,
        0.0133739235,
        -0.0037884058,
        -0.038263552,
        -0.092596754,
        -0.03480884,
        0.038813166,
        0.015114365,
        -0.004007597,
        -0.011450277,
        -0.010036985,
        0.02729746,
        0.015088193,
        0.0073478064,
        -0.011705454,
        -0.025687877,
        -0.0023898364,
        -0.033866648,
        -0.0561129,
        -0.011738169,
        -0.035777207,
        0.018608335,
        0.0090947915,
        -0.011875573,
        -0.0342854,
        -0.014525494,
        -0.082389645,
        0.0066869617,
        -0.0014018411,
        -0.04480657,
        0.014878817,
        0.0050708367,
        0.0034318115,
        -0.0045277667,
        -0.042503428,
        -0.018870056,
        -0.020361863,
        -0.023005242,
        -0.040933102,
        0.0016979125,
        -0.018595248,
        0.056165244,
        -0.012699992,
        -0.016828636,
        -0.029260363,
        -0.004213702,
        -0.01879154,
        -0.0026384708,
        0.012523332,
        -0.03643151,
        0.011162384,
        0.017338991,
        0.008905044,
        -0.011947546,
        0.001720813,
        0.03507056,
        0.010638943,
        0.011391389,
        -0.004596468,
        0.0074917525,
        0.0047306,
        0.004351105,
        0.02512518,
        -0.012549504,
        -0.035646345,
        0.0027022653,
        0.0013846656,
        -0.037138153,
        -0.02673476,
        -0.05268436,
        0.0066673327,
        0.015088193,
        0.0177054,
        -0.001195736,
        0.033997506,
        -0.044283126,
        0.029024815,
        -0.055170704,
        -0.026878707,
        -0.020989994,
        -0.007727301,
        0.01885697,
        0.012699992,
        -0.010867949,
        -0.024994317,
        -0.01542843,
        0.0254785,
        0.003647731,
        0.023136102,
        -0.010593141,
        -0.023293134,
        -0.046847988,
        0.016959496,
        0.026263664,
        0.043000698,
        0.027977934,
        -0.0007328177,
        -0.0017764287,
        0.037373703,
        0.011620395,
        0.014067483,
        -0.038786996,
        -0.014080569,
        0.008819984,
        -0.014224515,
        0.021670466,
        0.022102306,
        -0.030883033,
        -0.031406473,
        -0.017365163,
        -0.043576483,
        -0.0354108,
        0.040174115,
        0.010985723,
        0.012870111,
        -0.0278209,
        0.029548258,
        0.030281074,
        0.0016979125,
        0.010324878,
        -0.0019530901,
        -0.0008252378,
        0.02469334,
        0.0019203749,
        -0.0040566693,
        0.009016275,
        -0.00585927,
        0.03352641,
        -0.015663978,
        -0.02235094,
        0.0047862157,
        -0.030307246,
        0.010540797,
        -0.009932297,
   
Previous
Models
Next
Images
Built with