Ruby API reference
Create a Text Completion
Deprecated
completions.create(**kwargs) -> CompletionPOST/v1/complete
[Legacy] Create a Text Completion.
Create a Message
messages.create(**kwargs) -> MessagePOST/v1/messages
Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
Count tokens in a Message
messages.count_tokens(**kwargs) -> MessageTokensCountPOST/v1/messages/count_tokens
Count the number of tokens in a Message.
Get a Model
models.retrieve(model_id, **kwargs) -> ModelInfoGET/v1/models/{model_id}
Get a specific model.
Get Current Organization
organization.retrieve() -> OrganizationInfoGET/v1/organizations/me
Retrieve information about the organization associated with the authenticated API key.