OpenAI API
Overview
Deeptrin provides compatibility with the OpenAI API standard, allowing for easier integration into existing applications. This API supports Chat Completion and Completion endpoints, both in streaming and regular modes.
Base URL
https://api.deeptrin.com/inference-api/openai/v1
API Key
To use the API, you need to obtain a Deeptrin AI API Key. For detailed instructions, please refer to the authentication documentation.
Supported Models
meta-llama/Meta-Llama-3.1-8B-Instructmeta-llama/Meta-Llama-3.1-70B-Instruct...
As AI models continue to evolve, we will regularly update the list of supported models. While some models may be removed, we will strive to handle the transition in a way that ensures compatibility for users already integrated with these model APIs. For detailed information on the transition process, please refer to this.
Supported APIs
Chat Completion (streaming and regular)
Completion (streaming and regular)
Usage Examples
Python Client
First, install the OpenAI Python client:
Chat Completions API
Completions API
cURL Client
Chat Completions API
Completions API
Model Parameters
Please note that we are not yet 100% compatible with all OpenAI parameters. If you encounter any issues, you can start a discussion in our Discord server channel #issues.
Supported Parameters
model: Specify the model to use. Find all supported models here.messages: (ChatCompletion only) An array of message objects with roles (system, user, assistant) and content.prompt: (Completion only) The prompt to generate completions for.max_tokens: The maximum number of tokens to generate.stream: If set to true, partial message deltas will be sent as they become available.temperature: Controls randomness in output generation (0-2).top_p: Alternative to temperature, controls diversity via nucleus sampling.stop: Up to 4 sequences where the API will stop generating further tokens.n: Number of chat completion choices to generate for each input message.presence_penalty: Penalizes new tokens based on their presence in the generated text so far.frequency_penalty: Penalizes new tokens based on their frequency in the generated text so far.repetition_penalty: Penalizes new tokens based on their appearance in the prompt and generated text.logit_bias: Modifies the likelihood of specified tokens appearing in the output.
Migrating from OpenAI
If you're already using OpenAI's chat completion endpoint, you can easily switch to Deeptrin by:
Setting the base URL to
https://inference-api.deeptrin.ai/inference-api/openai/v1Obtaining and setting your Deeptrin API Key
Updating the model name according to your needs
For more information or support, please visit our website or join our Discord server.
Last updated