Grit API reference guide for creating, retrieving, canceling, and listing technical articles using HTTP requests or the official Python SDK.
Introduction
You can interact with the API through HTTP requests from any language, via our official Python SDK.
To install, run the following command:
pip install gritholdings
Note that this SDK is currently in private beta. Please reach out to support@meetgrit.com for more information.
Authentication
Grit uses API keys for authentication. Remember that your API key is a secret! Do not share it with others or expose it in any client-side code (browsers, apps). Production requests must be routed through your own backend server where your API key can be securely loaded from an environment variable or key management service.
All API requests should include your API key in an Authorization HTTP header as follows:
Authorization: Bearer GRIT_API_KEY
Example with gritholdings Python package:
from gritholdings import Gritclient =Grit( api_key="my_api_key")
Create article
POST https://api.meetgrit.com/v1/articles
Creates a technical article. This runs asynchronously. The time frame within which the article should be processed is 24 hours.
Request body
model string (required)
ID of the model to use. Only grit-1 is currently available.
input_text string (Required)
The ID of an input text that contains requests for the new technical article.
id string
errors array
|> code string
An error code identifying the error type.
|> message string
A human-readable message providing more details about the error.
status string
The current status of the batch.
output_file_id string
The text of the outputs of successfully executed requests.
in_progress_at string
The Unix timestamp (in seconds) for when the batch started processing.
completed_at string
The Unix timestamp (in seconds) for when the batch was completed.
failed_at string
The Unix timestamp (in seconds) for when the batch failed.