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

# Quickstart

> Setup HasteKit SDK in your project in seconds.

## Prerequisites

* Golang - [v1.25.0](https://go.dev/doc/devel/release#go1.25.0).

## Install HasteKit SDK

```bash theme={null}
go get -u github.com/hastekit/hastekit-sdk-go
```

## Setting up the SDK

```go theme={null}
package main

import (
    "os"

    hastekit "github.com/hastekit/hastekit-sdk-go"
    "github.com/hastekit/hastekit-sdk-go/pkg/gateway/llm/responses"
)

func main() {
    client := hastekit.NewLLMClient([]hastekit.ProviderConfig{
        {
            ProviderName:  hastekit.ProviderOpenAI,
            BaseURL:       "",
            CustomHeaders: nil,
            ApiKeys: []*hastekit.APIKeyConfig{
                {
                    Name:   "Key 1",
                    APIKey: os.Getenv("OPENAI_API_KEY"),
                },
            },
        },
    })
}
```

## Making LLM Calls

Make a call to the model provider to generate a response:

```go theme={null}
model := client.Model("OpenAI/gpt-4.1-mini")
resp, err := model.NewResponses(ctx, &responses.Request{
    Instructions: utils.Ptr("You are a helpful assistant."),
    Input: responses.InputUnion{
        OfString: utils.Ptr("What is the capital of France?"),
    },
})
```

Finally, extract the generated text from the response:

```go theme={null}
for _, output := range resp.Output {
    if output.OfOutputMessage != nil {
        for _, content := range output.OfOutputMessage.Content {
            if content.OfOutputText != nil {
                fmt.Println(content.OfOutputText.Text)
            }
        }
    }
}
```

<Card title="Responses API" icon="arrow-right" href="/docs/hastekit-sdk/responses/responses-api">
  Learn more about making LLM calls with the Responses API.
</Card>

## Creating Agents

Create a simple agent with system instructions and an LLM:

```go theme={null}
agent := hastekit.NewAgent(&hastekit.AgentConfig{
    Name:        "Assistant",
    Instruction: hastekit.NewPrompt("You are a helpful assistant."),
    LLM:         client.Model("OpenAI/gpt-4o-mini"),
})
```

Execute the agent with user messages. `Execute()` returns an `*AgentHandle`; the simplest way to get the aggregated `AgentOutput` is `handle.Result()`, which drains the chunk stream internally. To render chunks live (e.g. forward to a UI), range over `handle.Chunks` yourself and then call `handle.Wait()`.

```go theme={null}
handle, err := agent.Execute(ctx, &agents.AgentInput{
    Message: history.Message{
        Messages: []responses.InputMessageUnion{
            responses.UserMessage("Hello!"),
        },
    },
})
if err != nil {
    log.Fatal(err)
}

out, err := handle.Result()
if err != nil {
    log.Fatal(err)
}
```

Extract the agent's response:

```go theme={null}
for _, output := range out.Output {
    if output.OfOutputMessage != nil {
        for _, content := range output.OfOutputMessage.Content {
            if content.OfOutputText != nil {
                fmt.Println(content.OfOutputText.Text)
            }
        }
    }
}
```

<Card title="Agents" icon="arrow-right" href="/docs/hastekit-sdk/agents/simple-agent">
  Learn more about building agents with the Agent SDK.
</Card>
