Greenophy API
Access Greenophy's hosted ESG substantiveness and neutral generic classifiers via simple POST endpoints. This guide covers authentication, the default base URL, the Python helper, and ready-to-run payload examples.
Authentication
The API uses token-based authentication. Include your partner token in the X-API-Key header on every request.
https://greenophy-service-70959934638.europe-west1.run.app
- Tokens are scoped per organisation. Reach out to tian.han@bristol.ac.uk if you need to rotate credentials.
 - Each successful call counts towards your plan quota. Default allocations are 1,000 requests/month.
 - Requests without a valid token return 401 Unauthorized.
 
Endpoints
The API exposes two classifiers: the ESG substantiveness pipeline and a neutral generic variant. Both accept free-form paragraphs in the text field and handle sentence segmentation server-side.
| Endpoint | Description | Returns | 
|---|---|---|
| 
               
                POST
                /api/substantiveness
               
             | 
            ESG fine-tuned pipeline classifying substantiveness for supervisory reviews. | Labels: Concrete Actions, Demonstrated Impact, Time-bound Commitments, Verification & Oversight, Not substantive. | 
| 
               
                POST
                /api/generic_classification
               
             | 
            Neutral variant for broader sustainability and communications content without supervisory framing. | Same label inventory delivered with a balanced confidence profile. | 
Request anatomy
Send JSON with a text string. Optional metadata fields (request_id, source) are echoed back to simplify traceability.
- # pip install greenophy
 - from greenophy import SubstantivenessClient
 - # Base URL defaults to the hosted Greenophy service
 - client = SubstantivenessClient(
 - api_key="f574b1030d1b5cb1fc6640638cdca07a0311908491d9181c98b8b7c789d07d49",
 - timeout=120,
 - )
 - response = client.classify_esg_text(
 - "We transitioned 70% of our fleet to EVs in 2023."
 - )
 - for item in response["results"]:
 - print(f"{item['label_name']}: {item['sentence']}")
 - print("Quota remaining:", response["meta"]["quota_remaining"])
 - # Swap to client.classify_generic_text(...) for the neutral model
 
- curl -X POST \
 - "https://greenophy-service-70959934638.europe-west1.run.app/api/substantiveness" \
 - -H "Content-Type: application/json" \
 - \" \"> -H "X-API-Key: <partner-token>" \
 - -d '{"text": "We transitioned 70% of our fleet to EVs in 2023."}'
 
Sample response
The API returns a JSON object with a results array and a meta section containing timing data and the remaining quota when applicable.
- {
 - "results": [
 - {
 - "index": 0,
 - "sentence": "In 2023 we transitioned 70% of our fleet to EVs.",
 - "label": 1,
 - "label_name": "Concrete Actions"
 - }
 - ],
 - "meta": {
 - "count": 1,
 - "processing_seconds": 0.41,
 - "source": "text",
 - "quota_remaining": 998
 - }
 - }
 
Error handling
Requests missing content return 400 Bad Request with detail describing the missing field.
- {
 - "detail": "Provide text."
 - }
 
Exceeding your quota returns 429 Too Many Requests. Retry after the window resets or contact Greenophy for higher throughput.
Field reference
| Field | Type | Description | 
|---|---|---|
| text | string | Paragraph or multi-sentence disclosure to classify. The service performs sentence splitting server-side. | 
| request_id | string (optional) | Custom identifier echoed in meta.request_id for reconciliation. | 
| source | string (optional) | Label the upstream system (e.g., “dashboard-upload”, “batch-sync”). |