Text model API
GPT-4.1 API
GPT-4.1 is our flagship model for complex tasks. It is well suited for problem solving across domains.It features a substantial 1 million token context window, enabling it to process and understand extensive inputs effectively. The model excels in coding tasks, instruction following, and long-context comprehension, demonstrating a 21% improvement over GPT-4o and a 27% gain over GPT-4.5 in coding benchmarks .
- Model id
gpt-4-1- Takes
- Text (required) + Image (optional)
- Makes
- Text
- Endpoint
POST /api/v1/chat/completions- Made by
- OpenAI
- Mode
- Synchronous
Call GPT-4.1
https://payload.rentprompts.com/api/v1. Replace the placeholder with your key.Model gpt-4-1
POST /api/v1/chat/completions
curl https://payload.rentprompts.com/api/v1/chat/completions \
-H "Authorization: Bearer rp_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4-1",
"messages": [
{
"role": "user",
"content": "Write a haiku about APIs."
}
],
"max_tokens": 256
}'Replace rp_live_YOUR_KEY with your key, ideally via the RENTPROMPTS_API_KEY environment variable. Keys are shown only once, so they are never filled in here. Get your API key →
What a typical call costs
- 1 request7.09 Joules
- 10 requests70.9 Joules
Send requests to POST /api/v1/chat/completions. GPT-4.1 answers synchronously: the result comes back in the response to the same request.