Forefront
Search…
HTTP API
How to inference GPT-J with the HTTP API.
post
https://deployment-name-team-slug.forefront.link
Create Completion

Example Request

Python
cURL
1
import requests
2
3
headers = {"Authorization": "Bearer <INSERT_YOUR_TOKEN>"}
4
5
data = {
6
"text": "Once upon a time",
7
"top_p": 1,
8
"top_k": 40,
9
"temperature": 0.8,
10
"repetition_penalty": 1.2,
11
"length": 256,
12
"stop_sequences": ["bird", "cat", "dog"]
13
}
14
15
res = requests.post(
16
"https://vanilla-gpt-j-forefront.forefront.link",
17
json=data,
18
headers=headers
19
)
Copied!
1
curl https://DEPLOYMENT_NAME-TEAM_SLUG.forefront.link \
2
-H 'Content-Type: application/json' \
3
-H 'Authorization: Bearer YOUR_API_KEY' \
4
-d '{
5
"text": "Once upon a time",
6
"top_p": 1,
7
"top_k": 40,
8
"temperature": 0.8,
9
"repetition_penalty": 1.2,
10
"length": 256,
11
"stop_sequences": ["bird", "cat", "dog"]
12
}'
Copied!

Retrieving API Key

To retrieve your API key, navigate to Settings > API Key.

Retrieving Model URL

To retrieve your model URL, navigate to the deployment and copy the URL under the model name.
Last modified 5d ago