Skip to main content
This guide will walk you through making your first API call to Shakti Studio’s pre-deployed models. Before starting, ensure you have signed up for a Shakti Studio account.

Prerequisites

  • A Shakti Studio account
  • Basic Python knowledge
  • Python 3.8+ installed on your system

Step-by-Step Guide

1

Access the Playground

  1. Log in to your Shakti Studio account
  2. From the left sidebar, click on Playground
  3. In the model dropdown, select Gemma 3 1B. (For example purposes, Gemma 3 1B is considered here. Any other LLM can be used as well.)
  4. You’ll see an interactive chat interface where you can test the model directly Playground interface with model selection
2

Get API Details

  1. In the Playground, click on Get API details in the left sidebar
  2. You’ll be redirected to a page with ready-to-use code snippets
  3. Note that both Python (OpenAI client) and cURL examples are provided
  4. Copy the provided code snippet or use the given below
The API is compatible with any OpenAI-compliant client library, not just the official Python SDK.
3

Create Your Python Script

Create a new file named inference.py with the following code:
Remember to replace "YOUR_API_KEY" and YOUR_MODEL_ENDPOINT with the actual API key and model endpoint you generated in the previous steps.
4

Generate an API Key

  1. Navigate to Settings > API Keys from the main sidebar
  2. Click Generate New Key
  3. Provide a descriptive name for your key (must be unique)
  4. Set an appropriate expiration date
  5. Copy the generated API key (you won’t be able to see it again) Generate API Key
Keep your API key secure and never expose it in client-side code or public repositories.
5

Run Your Script

  1. Install the OpenAI Python client if you haven’t already:
  1. Run your script:
  1. You should see the model’s response to your query streaming in your terminal!
Congratulations! 🎉 You’ve successfully made your first API call to a Shakti Studio model.

Understanding Serverless vs. Dedicated Endpoints

In this quickstart, you used a serverless endpoint - a pre-deployed model that’s available to all Shakti Studio users. While convenient for testing and development, serverless endpoints have some limitations:

Serverless Endpoints

  • Quick to get started and no deployment required
  • Easy switching between different models
  • Pay-as-you-go pricing
  • Limited customization options

Dedicated Endpoints

  • Private to your organisation and optimised for your needs
  • Option to choose from a wide range of customisation
  • Deploy and scale your proprietary model hassle-free
  • Better control over latency, throughput, and costs

Next Steps

Ready to take your AI implementation further? Try these next steps: