Skip to content

Commit 861439c

Browse files
committed
Fix code example & display style
1 parent d1f39b6 commit 861439c

File tree

16 files changed

+43
-25
lines changed

16 files changed

+43
-25
lines changed

404.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

assets/md/api-reference/chat-completions/curl.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
```bash
22
curl -X POST "https://api.forge.tensorblock.co/v1/chat/completions" \
33
-H "Content-Type: application/json" \
4+
-H "Authorization: Bearer $FORGE_API_KEY" \
45
-d '{
56
"model": "OpenAI/gpt-4o",
67
"messages": [

assets/md/api-reference/chat-completions/go.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ func main() {
2121
}`)
2222
req, _ := http.NewRequest("POST", url, body)
2323
req.Header.Add("Content-Type", "application/json")
24+
req.Header.Add("Authorization", "Bearer $FORGE_API_KEY")
2425
res, _ := http.DefaultClient.Do(req)
2526
defer res.Body.Close()
2627
body, _ := ioutil.ReadAll(res.Body)
2728

2829
fmt.Println(res)
2930
fmt.Println(string(body))
30-
}
31-
```
31+
}

assets/md/api-reference/chat-completions/javascript.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ const body = JSON.stringify({
1010
})
1111

1212
fetch("https://api.forge.tensorblock.co/v1/chat/completions", {
13+
method: "POST",
14+
headers: {
15+
"Content-Type": "application/json",
16+
"Authorization": "Bearer $FORGE_API_KEY"
17+
},
1318
body
14-
})
15-
```
19+
})

assets/md/api-reference/chat-completions/python.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ body = {
1212
]
1313
}
1414
response = requests.request("POST", url, json = body, headers = {
15-
"Content-Type": "application/json"
15+
"Content-Type": "application/json",
16+
"Authorization": "Bearer $FORGE_API_KEY"
1617
})
1718

1819
print(response.text)
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
```bash
2-
curl -X GET "https://api.forge.tensorblock.co/"
2+
curl -X GET "https://api.forge.tensorblock.co/" \
3+
-H "Authorization: Bearer $FORGE_API_KEY"
34
```

assets/md/api-reference/health-check/go.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ func main() {
1111
url := "https://api.forge.tensorblock.co/"
1212

1313
req, _ := http.NewRequest("GET", url, nil)
14+
req.Header.Add("Authorization", "Bearer $FORGE_API_KEY")
1415

1516
res, _ := http.DefaultClient.Do(req)
1617
defer res.Body.Close()
1718
body, _ := ioutil.ReadAll(res.Body)
1819

1920
fmt.Println(res)
2021
fmt.Println(string(body))
21-
}
22-
```
22+
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
```javascript
2-
fetch("https://api.forge.tensorblock.co/")
2+
fetch("https://api.forge.tensorblock.co/", {
3+
headers: {
4+
"Authorization": "Bearer $FORGE_API_KEY"
5+
}
6+
})
37
```

assets/md/api-reference/health-check/python.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import requests
33

44
url = "https://api.forge.tensorblock.co/"
55

6-
response = requests.request("GET", url)
6+
response = requests.request("GET", url, headers = {
7+
"Authorization": "Bearer $FORGE_API_KEY"
8+
})
79

8-
print(response.text)
9-
```
10+
print(response.text)
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
```bash
2-
curl -X GET "https://api.forge.tensorblock.co/v1/models"
2+
curl -X GET "https://api.forge.tensorblock.co/v1/models" \
3+
-H "Authorization: Bearer $FORGE_API_KEY"
34
```

0 commit comments

Comments
 (0)