Get the API key

From Master of Neuroscience Wiki
Revision as of 17:28, 3 November 2025 by Davrot (talk | contribs) (Created page with "Test your API key:<syntaxhighlight lang="python3"> from openai import OpenAI # API configuration api_key = "XXXXXXXXXXXXXXXXX" # Replace with your API key base_url = "https://chat-ai.academiccloud.de/v1" # Start OpenAI client client = OpenAI(api_key=api_key, base_url=base_url) # List all available models models = client.models.list() # Print all models for model in models: print(model.id) print() </syntaxhighlight>The result is:<syntaxhighlight lang="python-cons...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Test your API key:

from openai import OpenAI

# API configuration
api_key = "XXXXXXXXXXXXXXXXX"  # Replace with your API key
base_url = "https://chat-ai.academiccloud.de/v1"

# Start OpenAI client
client = OpenAI(api_key=api_key, base_url=base_url)

# List all available models
models = client.models.list()

# Print all models
for model in models:
    print(model.id)
print()

The result is:

qwen3-coder-30b-a3b-instruct
meta-llama-3.1-8b-instruct
openai-gpt-oss-120b
gemma-3-27b-it
qwen3-30b-a3b-thinking-2507
qwen3-30b-a3b-instruct-2507
qwen3-32b
qwen3-235b-a22b
llama-3.3-70b-instruct
qwen2.5-vl-72b-instruct
medgemma-27b-it
qwq-32b
deepseek-r1
deepseek-r1-distill-llama-70b
mistral-large-instruct
qwen2.5-coder-32b-instruct
internvl2.5-8b
teuken-7b-instruct-research
codestral-22b
llama-3.1-sauerkrautlm-70b-instruct
meta-llama-3.1-8b-rag
qwen2.5-omni-7b