> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zerogpu.ai/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 [ZeroGPU dashboard](https://platform.zerogpu.ai/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](/docs/model-catalog) |

## 2. Send a request

<CodeGroup>
  ```bash cURL wrap theme={null}
  curl https://api.zerogpu.ai/v1/responses \
    -H "content-type: application/json" \
    -H "x-api-key: $ZEROGPU_API_KEY" \
    -H "x-project-id: $ZEROGPU_PROJECT_ID" \
    -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["ZEROGPU_API_KEY"],
      project_id=os.environ["ZEROGPU_PROJECT_ID"],
  )

  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.ZEROGPU_API_KEY,
    projectId: process.env.ZEROGPU_PROJECT_ID,
  });

  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.zerogpu.ai/v1/responses")
          .header("content-type", "application/json")
          .header("x-api-key", "YOUR_API_KEY")
          .header("x-project-id", "YOUR_PROJECT_ID")
          .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.zerogpu.ai/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")
    req.Header.Set("x-project-id", "YOUR_PROJECT_ID")

    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.zerogpu.ai/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['x-project-id'] = 'YOUR_PROJECT_ID'

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

  response = http.request(request)
  puts response.body
  ```
</CodeGroup>

<Warning>
  Store your API key in environment variables. Never commit it to version control or expose it in client-side code.
</Warning>

## 3. See a complete example

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

<CodeGroup>
  ```bash cURL wrap theme={null}
  curl https://api.zerogpu.ai/v1/responses \
    -H "content-type: application/json" \
    -H "x-api-key: $ZEROGPU_API_KEY" \
    -H "x-project-id: $ZEROGPU_PROJECT_ID" \
    -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["ZEROGPU_API_KEY"],
      project_id=os.environ["ZEROGPU_PROJECT_ID"],
  )

  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.ZEROGPU_API_KEY,
    projectId: process.env.ZEROGPU_PROJECT_ID,
  });

  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.zerogpu.ai/v1/responses")
          .header("content-type", "application/json")
          .header("x-api-key", "YOUR_API_KEY")
          .header("x-project-id", "YOUR_PROJECT_ID")
          .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.zerogpu.ai/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")
    req.Header.Set("x-project-id", "YOUR_PROJECT_ID")

    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.zerogpu.ai/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['x-project-id'] = 'YOUR_PROJECT_ID'

  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
  ```
</CodeGroup>

🎉 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`, your API key is wrong. A `403` means a bad project ID - see [Authentication](/docs/platform#authentication).

## Next steps

<Columns cols={3}>
  <Card title="API Reference" icon="terminal" href="/api-reference/responses" />

  <Card title="How ZeroGPU works" icon="diagram-project" href="/docs/how-zerogpu-works" />
</Columns>
