Python
Get started with Python using the Yescale AI with OpenAI
This guide will help you get started with Python using the Yescale AI with OpenAI.
Ensure your Python version is 3.6+
Make sure you are using Python version 3.6 or higher. You can check your Python version by running the following command in your terminal:
python --version
If you need to upgrade your Python version, follow the instructions specific to your operating system.
Install the OpenAI SDK
Run the following command in your terminal:
Create an account on Yescale
Go to Yescale and create an account. You will get an API key that you can use to access the Yescale API.
Change the endpoint and use your API key
Change the endpoint to Yescale’s endpoint and use your API key to authenticate your requests. For example:
import openai
client = openai.OpenAI(api_key="YOUR_API_KEY", base_url="https://yescale.one/v1")
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{
"role": "system",
"content": "Hello, how can I help you today?"
},
{
"role": "user",
"content": "I need help with my account."
}
]
)
print(response)
This ensures that the script is set up to run on Python 3.6 or higher. You can now run the script and see the output. If you have any questions or need help, please contact our support team. Make sure to replace "YOUR_API_KEY"
with your actual API key from Yescale and adjust the endpoint to match Yescale’s endpoint.