Quickstart
Get started using the SambaNova Cloud API in just a few minutes.
Get your API key.
Visit the API section of the SambaNova Cloud portal to generate your API key. Save this value in a secure manner.
Pick a model.
The SambaNova Cloud is frequently updated with latest open source models, running at the fastest tokens per second. View the full list on our supported models page. Select one from the list and refer to it using its corresponding model-ID.
We’ll use Meta-Llama-3.1-405B-Instruct
as an example for the remainder of this guide.
Make an API request.
You can make an inference request in multiple ways. See two examples below:
-
CURL command – Send a request directly from the command line.
-
Python (OpenAI client Library) – Use python for a more flexible integration.
CURL command
In a terminal window, run the CURL command to make your first request to the API.
OpenAI client library
To get started, ensure you have Python 3 and pip installed. Then, install the OpenAI library using pip in a terminal window.
Next, copy the following code into a Python file called, hello_world.py
.
Once copied into the hello_world.py
file, replace the string field in <"YOUR API KEY">
with your API Key value. Then run the file with the command below in a terminal window.
After you run the program, you should now see an output like similar to the one below.
Next Steps
Now that you can make requests to a model, great potential of building AI-powered applications await. Get inspired of what to build by exploring our AI Starter Kits, a collection of open-source Python projects.