Skip to main content
Here’s how you can make your first API request using the ShuttleAI API. Replace $SHUTTLEAI_API_KEY with your API key, which you can find on our Dashboard.
Each model has a specific request_multiplier that equates to the number of “requests” deducted per use. Find detailed information about each model including it’s limits and request multipler at our Dashboard.
curl https://api.shuttleai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $SHUTTLEAI_API_KEY" \
  -d '{
     "model": "shuttle-3.5",
     "messages": [{"role": "user", "content": "Say this is a test!"}],
     "temperature": 0.7,
     "max_tokens": 5
   }'
When you send a request to the shuttle-3.5 model with specified parameters like max_tokens and temperature, you’ll receive a response akin to this:
{
  "id": "chatcmpl-6ee59e89dfd1436cbf29d90c3c2168f5",
  "object": "chat.completion",
  "created": 1730229481,
  "model": "shuttle-3.5",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I assist you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 7,
    "completion_tokens": 9,
    "total_tokens": 16,
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
  }
}
This response illustrates the successful processing of your ChatCompletion request.

Understanding the Response

  • finish_reason: “length” indicates that the response ended because it reached the max_tokens limit. Other possible values include “stop” and “tool_calls”.
  • completion_tokens: Shows the number of tokens used to generate the response, which will not exceed the set max_tokens.
Want to receive data in real-time as it’s generated? Explore Streaming!
I