Skip to main content

Model Invocation

You can invoke models through the interface experience area and API.

Model Experience

Each model has its own experience interface. You can fill in model request parameters through a web form, and the output results will be displayed on the interface. The first run of a model can be tested this way, and later you can use the API method for stable usage. Both model experience and API invocation will be charged based on each call volume (such as the number of tokens) or the runtime of the request.

API Invocation

You can request each model's API in multiple ways, including HTTP, Node.js, and Python. For text dialogue official APIs, OpenAI format compatibility is supported. API invocation requires an API Key, which can be viewed and managed on the API Key page.

Invoke API via HTTP

curl -X POST "https://api.gpugeek.com/predictions" \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-H "Stream: true" \
-d "{\"model\": \"GpuGeek/DeepSeek-R1-671B\", \"input\": {
\"frequency_penalty\": 0,
\"max_tokens\": 8192,
\"prompt\": \"\",
\"temperature\": 0.6,
\"top_p\": 0.7
}}"

Invoke API via Python Client

Import the requests module

API_KEY = "your_api_key"

Set the request url

url = 'https://api.gpugeek.com/predictions';

Set request headers

headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
"Stream": "true"
}

Set request parameters

data = {
"model": "GpuGeek/DeepSeek-R1-671B", # Replace with your model name
# Replace with actual input parameters
"input": {
"frequency_penalty": 0,
"max_tokens": 8192,
"prompt": "",
"temperature": 0.6,
"top_p": 0.7
}
}

Send the POST request

response = requests.post(url, headers=headers, json=data)

Check response status code and print response content

if response.status_code == 200:
for line in response.iter_lines():
if line:
print(line.decode("utf-8"))
else:
print("Error:", response.status_code, response.text)

Invoke API via Node.js Client

Import the axios module and the stream module

const axios = require('axios');
const { Readable } = require('stream');

Set the API_KEY variable

const API_KEY = 'your_gpugeek_api_token';

Set the request URL

const url = 'https://api.gpugeek.com/predictions';

Set request headers

const headers = {
"Authorization": "Bearer API_KEY",
"Content-Type": "application/json",
"Stream": "true"
};

Request body data

const data = {
"model": "GpuGeek/DeepSeek-R1-671B", // Replace with your model name
// Replace with actual input parameters
input: {
"frequency_penalty": 0,
"max_tokens": 8192,
"prompt": "",
"temperature": 0.6,
"top_p": 0.7
},
};

Send the POST request

axios.post(url, data, {
headers: headers,
responseType: 'stream' // Set response type to stream
})
.then(response => {
const readableStream = Readable.from(response.data);

readableStream.on('data', (chunk) => {
console.log(chunk.toString('utf-8'));
});

readableStream.on('error', (err) => {
console.error('Stream error:', err.message);
});
})
.catch(error => {
if (error.response) {
console.error("Error:", error.response.status, error.response.statusText);
} else {
console.error("Error:", error.message);
}
});

OpenAI-Compatible Mode

Install OpenAI

pip install openai==1.63.2

Import the OpenAI module

from openai import OpenAI

Initialize the OpenAI client

client = OpenAI(
api_key="your_api_key", # your api key
base_url="https://api.gpugeek.com/v1", # endpoint
)

Send request

stream = client.chat.completions.create(
model="GpuGeek/DeepSeek-R1-671B",
stream=True,
frequency_penalty=0,
max_tokens=8192,
messages=[
{
"role": "user",
"content": "",
}
],
temperature=0.6,
top_p=0.7,

)

for chunk in stream:
print(chunk.choices[0].delta.content)