Pontos de extremidade da API REST para integrações de modelo
Use a API REST para trabalhar com solicitações de integração para modelos.
Run an embedding request attributed to an organization
This endpoint allows you to run an embedding request attributed to a specific organization. You must be a member of the organization and have enabled models to use this endpoint.
The token used to authenticate must have the models: read permission if using a fine-grained PAT or GitHub App minted token.
The request body should contain the model ID and the input text(s) for the embedding request. The response will include the generated embeddings.
Parâmetros para "Run an embedding request attributed to an organization"
| Nome, Tipo, Descrição | 
|---|
| acceptstringSetting to  | 
| Nome, Tipo, Descrição | 
|---|
| orgstring ObrigatórioThe organization login associated with the organization to which the request is to be attributed. | 
| Nome, Tipo, Descrição | 
|---|
| api-versionstringThe API version to use. Optional, but required for some features. | 
| Nome, Tipo, Descrição | 
|---|
| modelstring ObrigatórioID of the specific model to use for the request. The model ID should be in the format of {publisher}/{model_name} where "openai/text-embedding-3-small" is an example of a model ID. You can find supported models in the catalog/models endpoint. | 
| inputstring or array ObrigatórioInput text to embed, encoded as a string or array of strings. To embed multiple inputs in a single request, pass an array of strings. Each input must not exceed the max input tokens for the model, cannot be an empty string, and any array must be 2048 dimensions or less. | 
| encoding_formatstringThe format to return the embeddings in. Can be either float or base64. Padrão:  Pode ser um dos:  | 
| dimensionsintegerThe number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models. | 
| userstringA unique identifier representing your end-user, which can help us to monitor and detect abuse. | 
Códigos de status de resposta HTTP para "Run an embedding request attributed to an organization"
| Código de status | Descrição | 
|---|---|
| 200 | OK | 
Exemplos de código para "Run an embedding request attributed to an organization"
Exemplo de solicitação
curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://models.github.ai/orgs/ORG/inference/embeddings \
  -d '{"model":"openai/text-embedding-3-small","input":["The food was delicious and the waiter was very friendly.","I had a great time at the restaurant."]}'Resposta
Status: 200{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0.0023064255,
        -0.009327292,
        -0.0028842222
      ]
    }
  ],
  "model": "openai/text-embedding-3-small",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}Run an embedding request
This endpoint allows you to run an embedding request. The token used to authenticate must have the models: read permission if using a fine-grained PAT or GitHub App minted token.
The request body should contain the model ID and the input text(s) for the embedding request. The response will include the generated embeddings.
Parâmetros para "Run an embedding request"
| Nome, Tipo, Descrição | 
|---|
| acceptstringSetting to  | 
| Nome, Tipo, Descrição | 
|---|
| api-versionstringThe API version to use. Optional, but required for some features. | 
| Nome, Tipo, Descrição | 
|---|
| modelstring ObrigatórioID of the specific model to use for the request. The model ID should be in the format of {publisher}/{model_name} where "openai/text-embedding-3-small" is an example of a model ID. You can find supported models in the catalog/models endpoint. | 
| inputstring or array ObrigatórioInput text to embed, encoded as a string or array of strings. To embed multiple inputs in a single request, pass an array of strings. Each input must not exceed the max input tokens for the model, cannot be an empty string, and any array must be 2048 dimensions or less. | 
| encoding_formatstringThe format to return the embeddings in. Can be either float or base64. Padrão:  Pode ser um dos:  | 
| dimensionsintegerThe number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models. | 
| userstringA unique identifier representing your end-user, which can help us to monitor and detect abuse. | 
Códigos de status de resposta HTTP para "Run an embedding request"
| Código de status | Descrição | 
|---|---|
| 200 | OK | 
Exemplos de código para "Run an embedding request"
Exemplo de solicitação
curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://models.github.ai/inference/embeddings \
  -d '{"model":"openai/text-embedding-3-small","input":["The food was delicious and the waiter was very friendly.","I had a great time at the restaurant."]}'Resposta
Status: 200{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0.0023064255,
        -0.009327292,
        -0.0028842222
      ]
    }
  ],
  "model": "openai/text-embedding-3-small",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}