=encoding utf8

=head1 NAME

OpenAPI::Client::OpenAI::Path::embeddings - Documentation for the /embeddings path.

=head1 OPERATIONS

=head2 POST /embeddings

=head3 createEmbedding

  $client->create_embedding({
      body => { ... },
  });

Creates an embedding vector representing the input text.

=head4 Responses

B<200 - OK>

Content-Type: application/json

Example:

    {
       "data" : [
          "{\n  \"object\": \"embedding\",\n  \"embedding\": [\n    0.0023064255,\n    -0.009327292,\n    .... (1536 floats total for ada-002)\n    -0.0028842222,\n  ],\n  \"index\": 0\n}\n"
       ],
       "model" : "string",
       "object" : "list",
       "usage" : {
          "prompt_tokens" : 0,
          "total_tokens" : 0
       }
    }

=head1 SCHEMAS

=head2 CreateEmbeddingRequest

Properties:

=over

=item * C<dimensions> (integer) - The number of dimensions the resulting output embeddings should have. Only
supported in C<text-embedding-3> and later models.

=item * C<encoding_format> (string) - The format to return the embeddings in. Can be either C<float> or
L<C<base64>|https://pypi.org/project/pybase64/>.

Allowed values: float, base64

Default: float

=item * C<input> (oneOf, required) - Input text to embed, encoded as a string or array of tokens. To embed multiple
inputs in a single request, pass an array of strings or array of token arrays.
The input must not exceed the max input tokens for the model (8192 tokens for
all embedding models), cannot be an empty string, and any array must be 2048
dimensions or less.
L<Example Python code|https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken>
for counting tokens. In addition to the per-input token limit, all embedding
models enforce a maximum of 300,000 tokens summed across all inputs in a
single request.

=item * C<model> (anyOf, required) - ID of the model to use. You can use the
L<List models|https://platform.openai.com/docs/api-reference/models/list> API
to see all of your available models, or see our
L<Model overview|https://platform.openai.com/docs/models> for descriptions of
them.

=item * C<user> (string) - A unique identifier representing your end-user, which can help OpenAI to
monitor and detect abuse.
L<Learn more|https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids>
.

=back

=head2 CreateEmbeddingResponse

Properties:

=over

=item * C<data> (array of Embedding, required) - The list of embeddings generated by the model.

=item * C<model> (string, required) - The name of the model used to generate the embedding.

=item * C<object> (string, required) - The object type, which is always "list".

Allowed values: list

=item * C<usage> (object, required) - The usage information for the request.

=back

=head2 Embedding

Properties:

=over

=item * C<embedding> (array of number, required) - The embedding vector, which is a list of floats. The length of vector depends
on the model as listed in the
L<embedding guide|https://platform.openai.com/docs/guides/embeddings> .

=item * C<index> (integer, required) - The index of the embedding in the list of embeddings.

=item * C<object> (string, required) - The object type, which is always "embedding".

Allowed values: embedding

=back

=head1 SEE ALSO

L<OpenAPI::Client::OpenAI::Path>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2023-2026 by Nelson Ferraz

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.14.0 or,
at your option, any later version of Perl 5 you may have available.

=cut
