AITRE API Documents(English)
  1. Embeddings Interface(Embeddings)
AITRE API Documents(English)
  • AITRE Introduction
  • Project Description
  • Send Request
  • Openai's format(Chat)
    • Gpt-4o-image(Generate Image)
      POST
    • Chat Completions Interface
      POST
  • Audio Interface(Audio)
    • TTS(speech-to-text)
      POST
    • Transcriptions
      POST
    • Translations
      POST
  • Embeddings Interface(Embeddings)
    • Embeddings
    • Create Embeddings
      POST
  • Images Generations(Images)
    • Openai's format Gpt-image-1
      POST
    • Openai's format Flux
      POST
    • Openai's format DALL·E 3
      POST
  • Models Interface(Models)
    • Model
      GET
  • Auto Completions Interface(Completions)
    • Completions
      POST
  • MidJourney
    • Description
    • Fetch task by id
      GET
    • Action
      POST
    • Blend(image to image)
      POST
    • Describe (image to text)
      POST
    • Imagine (text to image/image to image)
      POST
    • Modal(Partial redrawing、ZOOM)
      POST
    • Shorten(prompt analysis)
      POST
  1. Embeddings Interface(Embeddings)

Create Embeddings

POST
{{BASE_URL}}/v1/embeddings
Obtain a vector representation of the given input, which machine learning models and algorithms can easily use.
Related guidelines: [Insert]( https://platform.openai.com/docs/guides/embeddings )
Create an embedding vector representing the input text.

Request

Header Params
Authorization
string 
required
Provide your bearer token in the Authorization header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Example:
Bearer {{YOUR_API_KEY}}
Body Params application/json
model
string 
required
The ID of the model to be used. You can use [List models]( https://platform.openai.com/docs/api-reference/models/list )API to view all available models, or view our [Model Overview]( https://platform.openai.com/docs/models/overview )To understand their descriptions.
input
string 
required
Enter text to obtain embeddings, encoded as strings or tag arrays. To obtain embeddings for multiple inputs in a single request, pass a string array or token array array. The length of each input must not exceed 8192 tags.
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 -g --request POST '{{BASE_URL}}/v1/embeddings' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "model": "text-embedding-3-large",
  "input": "The food was delicious and the waiter..."
}'

Responses

🟢200Create embeddings
application/json
Body
object
string 
required
data
array [object {3}] 
required
object
string 
optional
embedding
array[number]
optional
index
integer 
optional
model
string 
required
usage
object 
required
prompt_tokens
integer 
required
total_tokens
integer 
required
Example
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "embedding": [
        0.0023064255,
        -0.009327292,
        .... (1536 floats total for ada-002)
        -0.0028842222
      ],
      "index": 0
    }
  ],
  "model": "text-embedding-ada-002",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}
Previous
Embeddings
Next
Openai's format Gpt-image-1
Built with