The GPT-2.COM API is organized around the REST. Our API accepts JSON-encoded requests and returns JSON-encoded responses.
This method creates task for text generation
Url | https://gpt-2.com/api/createTask |
HTTP requests type | POST |
Request parameters
clientId | Your user ID |
clientKey | Your API key |
prefix | Beginning of text (50-100 symbols). The more relevant prefix results the better result. |
temperature | Optional. Default is 0.2 Float value from 0 to 2 which controlls randomness of text generation. As the temperature approaches zero, the model will become deterministic and repetitive. Higher temperature results in more random completions. |
Response parameters
taskId | this is ID of task which needed to get result |
prefix | prefix that you have sent |
errorCode | 0 - no errors, or error code |
errorDescription | error description or blank |
Getting task result
Url | https://gpt-2.com/api/getTaskResult |
HTTP requests type | POST |
Request parameters
clientId | Your user ID |
clientKey | Your API key |
taskId | Id of task |
Response parameters
errorCode | 0 - no errors, or error code |
errorDescription | error description or blank |
status | 'processing' or 'ready' |
solution | full text article |
userIP | IP address wchich made request |
createTime | Timestamp of creation time in unix format |
endTime | end task timestamp in unix format |
This method returns API units balance
Url | https://gpt-2.com/api/getBalance |
HTTP requests type | POST |
Request parameters
clientId | Your user ID |
clientKey | Your API key |
Response parameters
errorCode | 0 - no errors, or error code |
errorDescription | error description or blank |
balance | your API units balance |