Skip to main content

Amazon Nova

PropertyDetails
DescriptionAmazon Nova is a family of foundation models built by Amazon that deliver frontier intelligence and industry-leading price performance.
Provider Route on LiteLLMamazon_nova/
Provider DocAmazon Nova ↗
Supported OpenAI Endpoints/chat/completions, v1/responses
Other Supported Endpointsv1/messages, /generateContent

Authentication​

Amazon Nova uses API key authentication. You can obtain your API key from the Amazon Nova developer console ↗.

export AMAZON_NOVA_API_KEY="your-api-key"

Usage​

import os
from litellm import completion

# Set your API key
os.environ["AMAZON_NOVA_API_KEY"] = "your-api-key"

response = completion(
model="amazon_nova/nova-micro-v1",
messages=[
{"role": "system", "content": "You are a helpful assistant"},
{"role": "user", "content": "Hello, how are you?"}
]
)

print(response)

Supported Models​

Model NameUsageContext Window
Nova Microcompletion(model="amazon_nova/nova-micro-v1", messages=messages)128K tokens
Nova Litecompletion(model="amazon_nova/nova-lite-v1", messages=messages)300K tokens
Nova Procompletion(model="amazon_nova/nova-pro-v1", messages=messages)300K tokens
Nova Premiercompletion(model="amazon_nova/nova-premier-v1", messages=messages)1M tokens

Usage - Streaming​

import os
from litellm import completion

os.environ["AMAZON_NOVA_API_KEY"] = "your-api-key"

response = completion(
model="amazon_nova/nova-micro-v1",
messages=[
{"role": "system", "content": "You are a helpful assistant"},
{"role": "user", "content": "Tell me about machine learning"}
],
stream=True
)

for chunk in response:
print(chunk.choices[0].delta.content or "", end="")

Usage - Function Calling / Tool Usage​

import os
from litellm import completion

os.environ["AMAZON_NOVA_API_KEY"] = "your-api-key"

tools = [
{
"type": "function",
"function": {
"name": "getCurrentWeather",
"description": "Get the current weather in a given city",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City and country e.g. San Francisco, CA"
}
},
"required": ["location"]
}
}
}
]

response = completion(
model="amazon_nova/nova-micro-v1",
messages=[
{"role": "user", "content": "What's the weather like in San Francisco?"}
],
tools=tools
)

print(response)

Set temperature, top_p, etc.​

import os
from litellm import completion

os.environ["AMAZON_NOVA_API_KEY"] = "your-api-key"

response = completion(
model="amazon_nova/nova-pro-v1",
messages=[
{"role": "user", "content": "Write a creative story"}
],
temperature=0.8,
max_tokens=500,
top_p=0.9
)

print(response)

Model Comparison​

ModelBest ForSpeedCostContext
Nova MicroSimple tasks, high throughputFastestLowest128K
Nova LiteBalanced performanceFastLow300K
Nova ProComplex reasoningMediumMedium300K
Nova PremierMost advanced tasksSlowerHigher1M

Error Handling​

Common error codes and their meanings:

  • 401 Unauthorized: Invalid API key
  • 429 Too Many Requests: Rate limit exceeded
  • 400 Bad Request: Invalid request format
  • 500 Internal Server Error: Service temporarily unavailable