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

# Go SDK

> QWED Go SDK documentation. Install via go get, use context-based verification methods, and handle errors idiomatically in your Go applications.

## Installation

```bash theme={null}
go get github.com/QWED-AI/qwed-verification/sdk-go/v7
```

## Quick start

```go theme={null}
package main

import (
    "context"
    "fmt"
    qwed "github.com/QWED-AI/qwed-verification/sdk-go/v7"
)

func main() {
    client := qwed.NewClient("qwed_your_key")
    
    result, err := client.Verify(context.Background(), "Is 2+2=4?")
    if err != nil {
        panic(err)
    }
    
    fmt.Println(result.Verified)  // true
    fmt.Println(result.Status)    // "VERIFIED"
}
```

## Methods

### Verify

```go theme={null}
result, err := client.Verify(ctx, "2+2=4")
```

### VerifyMath

```go theme={null}
result, err := client.VerifyMath(ctx, "x**2 + 2*x + 1 = (x+1)**2")
fmt.Println(result.Verified)  // true
```

### VerifyLogic

```go theme={null}
result, err := client.VerifyLogic(ctx, "(AND (GT x 5) (LT y 10))")
fmt.Println(result.Model)  // map[x:6 y:9]
```

### VerifyCode

```go theme={null}
result, err := client.VerifyCode(ctx, code, "python")
for _, vuln := range result.Vulnerabilities {
    fmt.Printf("%s: %s\n", vuln.Severity, vuln.Message)
}
```

### VerifySQL

```go theme={null}
result, err := client.VerifySQL(ctx, query, schema)
```

### VerifyBatch

```go theme={null}
items := []qwed.BatchItem{
    {Query: "2+2=4", Type: qwed.TypeMath},
    {Query: "3*3=9", Type: qwed.TypeMath},
}
results, err := client.VerifyBatch(ctx, items)
fmt.Println(results.Summary.SuccessRate)
```

## Types

```go theme={null}
type VerificationResult struct {
    Status          string
    Verified        bool
    Engine          string
    Result          map[string]interface{}
    Vulnerabilities []Vulnerability
}
```

## Error handling

```go theme={null}
result, err := client.Verify(ctx, "test")
if err != nil {
    var qwedErr *qwed.Error
    if errors.As(err, &qwedErr) {
        fmt.Println(qwedErr.Code)
        fmt.Println(qwedErr.Message)
    }
}
```


## Related topics

- [QWED Protocol releases: SDK versions and installs](/releases.md)
- [SDKs overview](/sdks/overview.md)
- [Getting started](/integration/getting-started.md)
- [Installation](/getting-started/installation.md)
- [QWED Security rule catalog](/advanced/qwed-security-rule-catalog.md)


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