> ## Documentation Index
> Fetch the complete documentation index at: https://docs.herogpu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> First API call in minutes.

## 1. Grab your credentials

Log into the [herogpu dashboard](https://platform.herogpu.com/dashboard) and copy these three values:

| Credential | Where to find it |
| - | - |
| **API Key** | Dashboard → API Keys |
| **Project ID** (optional) | Dashboard → Project Settings - scopes requests to a project |
| **Model** | Dashboard → Model selector, or pick one from the [Model Catalog](https://docs.herogpu.com/docs/model-catalog.md) |

Send your API key in the `x-api-key` header, as the examples below do, or as `Authorization: Bearer <key>`. Both work on the inference endpoints. The [Batch & Files API](https://docs.herogpu.com/docs/batch/index.md) accepts `x-api-key` only. To use Bearer, swap the header:

```bash cURL wrap theme={null}
-H "Authorization: Bearer $HEROGPU_API_KEY"
```

```python Python wrap theme={null}
# pip install openai
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.herogpu.com/v1",
    api_key=os.environ["HEROGPU_API_KEY"],  # sent as Authorization: Bearer
)
```

```javascript JavaScript wrap theme={null}
// npm install openai
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api.herogpu.com/v1',
  apiKey: process.env.HEROGPU_API_KEY, // sent as Authorization: Bearer
});
```

```rust Rust wrap theme={null}
.header("Authorization", "Bearer YOUR_API_KEY")
```

```go Go wrap theme={null}
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
```

```ruby Ruby wrap theme={null}
request['Authorization'] = 'Bearer YOUR_API_KEY'
```

> [!NOTE]
>
> The `x-project-id` header is optional. Send it only to scope a request to a specific project.

## 2. Send a request

```bash cURL wrap theme={null}
curl https://api.herogpu.com/v1/responses \
  -H "content-type: application/json" \
  -H "x-api-key: $HEROGPU_API_KEY" \
  -d '{
    "model": "YOUR_MODEL",
    "input": "Your input text here..."
  }'
```

```python Python wrap theme={null}
# pip install zerogpu-api
import os
from zerogpu import ZerogpuApi

client = ZerogpuApi(
    api_key=os.environ["HEROGPU_API_KEY"],
)

response = client.responses.create_response(
    model="YOUR_MODEL",
    input="Your input text here...",
)
print(response)
```

```javascript JavaScript wrap theme={null}
// npm install zerogpu-api
import { ZerogpuApiClient } from 'zerogpu-api';

const client = new ZerogpuApiClient({
  apiKey: process.env.HEROGPU_API_KEY,
});

const response = await client.responses.createResponse({
  model: 'YOUR_MODEL',
  input: 'Your input text here...',
});

console.log(response.output);
```

```rust Rust wrap theme={null}
use reqwest::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();

    let payload = json!({
        "model": "YOUR_MODEL",
        "input": "Your input text here..."
    });

    let response = client
        .post("https://api.herogpu.com/v1/responses")
        .header("content-type", "application/json")
        .header("x-api-key", "YOUR_API_KEY")
        .json(&payload)
        .send()
        .await?;

    let body = response.text().await?;
    println!("{}", body);
    Ok(())
}
```

```go Go wrap theme={null}
package main

import (
  "bytes"
  "encoding/json"
  "fmt"
  "io"
  "net/http"
)

func main() {
  url := "https://api.herogpu.com/v1/responses"

  payload := map[string]any{
    "model": "YOUR_MODEL",
    "input": "Your input text here...",
  }

  payloadBytes, err := json.Marshal(payload)
  if err != nil {
    panic(err)
  }

  req, err := http.NewRequest("POST", url, bytes.NewBuffer(payloadBytes))
  if err != nil {
    panic(err)
  }

  req.Header.Set("content-type", "application/json")
  req.Header.Set("x-api-key", "YOUR_API_KEY")

  client := &http.Client{}
  res, err := client.Do(req)
  if err != nil {
    panic(err)
  }
  defer res.Body.Close()

  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

```ruby Ruby wrap theme={null}
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse('https://api.herogpu.com/v1/responses')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = (uri.scheme == 'https')

request = Net::HTTP::Post.new(uri.request_uri)
request['content-type'] = 'application/json'
request['x-api-key'] = 'YOUR_API_KEY'

request.body = {
  model: 'YOUR_MODEL',
  input: 'Your input text here...'
}.to_json

response = http.request(request)
puts response.body
```

> [!WARNING]
>
> Store your API key in environment variables. Never commit it to version control or expose it in client-side code.

## 3. See a complete example

A full request - here the `llama-3.1-8b-instruct-fast` model summarizing a passage:

```bash cURL wrap theme={null}
curl https://api.herogpu.com/v1/responses \
  -H "content-type: application/json" \
  -H "x-api-key: $HEROGPU_API_KEY" \
  -d '{
    "model": "llama-3.1-8b-instruct-fast",
    "input": "NASA announced that its Artemis III mission is now scheduled for late 2026, marking the first time astronauts will land on the lunar surface since Apollo 17 in 1972. The mission will send a crew of four to the Moon aboard the Orion spacecraft, with two astronauts descending to the south pole using SpaceX Starship as a lunar lander. Scientists are particularly excited about exploring permanently shadowed craters that may contain water ice, which could be critical for sustaining long-term human presence on the Moon."
  }'
```

```python Python wrap theme={null}
# pip install zerogpu-api
import os
from zerogpu import ZerogpuApi

client = ZerogpuApi(
    api_key=os.environ["HEROGPU_API_KEY"],
)

response = client.responses.create_response(
    model="llama-3.1-8b-instruct-fast",
    input="NASA announced that its Artemis III mission is now scheduled for late 2026, marking the first time astronauts will land on the lunar surface since Apollo 17 in 1972. The mission will send a crew of four to the Moon aboard the Orion spacecraft, with two astronauts descending to the south pole using SpaceX Starship as a lunar lander. Scientists are particularly excited about exploring permanently shadowed craters that may contain water ice, which could be critical for sustaining long-term human presence on the Moon.",
)
print(response)
```

```javascript JavaScript wrap theme={null}
// npm install zerogpu-api
import { ZerogpuApiClient } from 'zerogpu-api';

const client = new ZerogpuApiClient({
  apiKey: process.env.HEROGPU_API_KEY,
});

const response = await client.responses.createResponse({
  model: 'llama-3.1-8b-instruct-fast',
  input: 'NASA announced that its Artemis III mission is now scheduled for late 2026, marking the first time astronauts will land on the lunar surface since Apollo 17 in 1972. The mission will send a crew of four to the Moon aboard the Orion spacecraft, with two astronauts descending to the south pole using SpaceX Starship as a lunar lander. Scientists are particularly excited about exploring permanently shadowed craters that may contain water ice, which could be critical for sustaining long-term human presence on the Moon.',
});

console.log(response.output);
```

```rust Rust wrap theme={null}
use reqwest::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();

    let payload = json!({
        "model": "llama-3.1-8b-instruct-fast",
        "input": "NASA announced that its Artemis III mission is now scheduled for late 2026, marking the first time astronauts will land on the lunar surface since Apollo 17 in 1972. The mission will send a crew of four to the Moon aboard the Orion spacecraft, with two astronauts descending to the south pole using SpaceX Starship as a lunar lander. Scientists are particularly excited about exploring permanently shadowed craters that may contain water ice, which could be critical for sustaining long-term human presence on the Moon."
    });

    let response = client
        .post("https://api.herogpu.com/v1/responses")
        .header("content-type", "application/json")
        .header("x-api-key", "YOUR_API_KEY")
        .json(&payload)
        .send()
        .await?;

    let body = response.text().await?;
    println!("{}", body);
    Ok(())
}
```

```go Go wrap theme={null}
package main

import (
  "bytes"
  "encoding/json"
  "fmt"
  "io"
  "net/http"
)

func main() {
  url := "https://api.herogpu.com/v1/responses"

  payload := map[string]any{
    "model": "llama-3.1-8b-instruct-fast",
    "input": "NASA announced that its Artemis III mission is now scheduled for late 2026, marking the first time astronauts will land on the lunar surface since Apollo 17 in 1972. The mission will send a crew of four to the Moon aboard the Orion spacecraft, with two astronauts descending to the south pole using SpaceX Starship as a lunar lander. Scientists are particularly excited about exploring permanently shadowed craters that may contain water ice, which could be critical for sustaining long-term human presence on the Moon.",
  }

  payloadBytes, err := json.Marshal(payload)
  if err != nil {
    panic(err)
  }

  req, err := http.NewRequest("POST", url, bytes.NewBuffer(payloadBytes))
  if err != nil {
    panic(err)
  }

  req.Header.Set("content-type", "application/json")
  req.Header.Set("x-api-key", "YOUR_API_KEY")

  client := &http.Client{}
  res, err := client.Do(req)
  if err != nil {
    panic(err)
  }
  defer res.Body.Close()

  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

```ruby Ruby wrap theme={null}
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse('https://api.herogpu.com/v1/responses')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = (uri.scheme == 'https')

request = Net::HTTP::Post.new(uri.request_uri)
request['content-type'] = 'application/json'
request['x-api-key'] = 'YOUR_API_KEY'

request.body = {
  model: 'llama-3.1-8b-instruct-fast',
  input: 'NASA announced that its Artemis III mission is now scheduled for late 2026, marking the first time astronauts will land on the lunar surface since Apollo 17 in 1972. The mission will send a crew of four to the Moon aboard the Orion spacecraft, with two astronauts descending to the south pole using SpaceX Starship as a lunar lander. Scientists are particularly excited about exploring permanently shadowed craters that may contain water ice, which could be critical for sustaining long-term human presence on the Moon.'
}.to_json

response = http.request(request)
puts response.body
```

🎉 The model returns the summary:

```text wrap theme={null}
NASA's Artemis III mission is now scheduled for late 2026, marking the first lunar landing since Apollo 17 in 1972, with a crew of four astronauts aboard the Orion spacecraft, including two descending to the Moon's south pole using SpaceX Starship as a lunar lander to explore permanently shadowed craters potentially containing water ice crucial for sustaining a long-term human presence on the Moon.
```

## 4. Verify it worked

Check the dashboard:

* **Logs**: your request appears with model, status, and latency.
* **Usage**: token counts update in real time.

If you get a `401`, no API key was sent. A `403` means the API key is invalid or revoked.

## Next steps

> [card] [API Reference](https://docs.herogpu.com/api-reference/responses.md)

> [card] [How herogpu works](https://docs.herogpu.com/docs/how-zerogpu-works.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.