Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ai-data/generative-apis/api-cli/using-chat-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Creates a model response for the given chat conversation.
curl --request POST \
--url https://api.scaleway.ai/v1/chat/completions \
--header 'Authorization: Bearer ${SCW_SECRET_KEY}' \
--header 'Content-Type: application/json'
--header 'Content-Type: application/json' \
--data '{
"model": "llama-3.1-8b-instruct",
"messages": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dates:

All requests to the Scaleway Generative APIs must include an `Authorization` HTTP header with your API key prefixed by `Bearer`.

We recommend exporting your secret key as an environment variable, which you can then pass directly in your curl request as follows. Remember to replace the example value with your own API secret key.
We recommend exporting your secret key as an environment variable, which you can then pass directly in your curl request as follows. Remember to replace the example value with *your own API secret key*.

```
export SCW_SECRET_KEY=720438f9-fcb9-4ebb-80a7-808ebf15314b
Expand Down
4 changes: 2 additions & 2 deletions ai-data/generative-apis/how-to/query-text-models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ from openai import OpenAI
# Initialize the client with your base URL and API key
client = OpenAI(
base_url="https://api.scaleway.ai/v1", # Scaleway's Generative APIs service URL
api_key="<SCW_API_KEY>" # Your unique API key from Scaleway
api_key="<SCW_SECRET_KEY>" # Your unique API secret key from Scaleway
)
```

Expand All @@ -69,7 +69,7 @@ response = client.chat.completions.create(
messages=[{"role": "user", "content": "Describe a futuristic city with advanced technology and green energy solutions."}],
temperature=0.2, # Adjusts creativity
max_tokens=100, # Limits the length of the output
top_p=0.7 # Controls diversity through nucleus sampling
top_p=0.7 # Controls diversity through nucleus sampling. You usually only need to use temperature.
)

# Print the generated response
Expand Down
6 changes: 3 additions & 3 deletions ai-data/generative-apis/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ pip install openai
from openai import OpenAI

client = OpenAI(
base_url="https://api.scaleway.ai/v1",
api_key="<SCW_API_KEY>"
base_url="https://api.scaleway.ai/v1", # # Scaleway's Generative APIs service URL
api_key="<SCW_SECRET_KEY>" # Your unique API secret key from Scaleway
)
```

Make sure that you replace `<SCW_API_KEY>` with the API key obtained from your Scaleway account.
Make sure that you replace `<SCW_SECRET_KEY>` with the API key obtained from your Scaleway account.

<Message type="tip">
It is recommended to store your API keys securely using environment variables or [secret management tools](/identity-and-access-management/secret-manager/) to prevent unauthorized access.
Expand Down