Generate text (standalone prompt)

POST {{_baseUrl}}/models/:modelName/generations

Generate a response based on the provided prompt.

Request Body

{"prompt"=>"What is a REST API?"}

HEADERS

KeyDatatypeRequiredDescription
x-sfdc-app-contextstring(Required) This value is reserved for future use. For now, specify EinsteinGPT.
x-client-feature-idstring(Required) This value is reserved for future use. For now, specify ai-platform-models-connected-app.
Content-Typestring

RESPONSES

status: OK

{"id":"chatcmpl-9r3y59N86UGz87Z4pEffY5ZgzHajm","generation":{"id":"9570d969-3338-491f-869d-c3541b0913bb","generatedText":"A REST API (Representational State Transfer Application Programming Interface) is a software architectural style for designing networked applications. It is based on a set of principles and constraints that allow different systems to communicate over the internet using the HTTP protocol.\n\nIn a REST API, resources are exposed as URLs (Uniform Resource Locators), and different HTTP methods (such as GET, POST, PUT, DELETE) are used to perform operations on these resources. The API follows a stateless client-server communication model, where the server does not store any client state between requests.\n\nREST APIs are widely used for building web services and applications, as they provide a scalable, simple, and standardized way of exchanging data between different systems. They are often used in combination with JSON (JavaScript Object Notation) or XML (eXtensible Markup Language) to format the data being transferred.","contentQuality":{"scanToxicity":{"isDetected":false,"categories":[{"categoryName":"identity","score":0},{"categoryName":"hate","score":0},{"categoryName":"profanity","score":0},{"categoryName":"violence","score":0},{"categoryName":"sexual","score":0.0001},{"categoryName":"physical","score":0}]}},"parameters":{"finish_reason":"stop","index":0,"logprobs":null}},"moreGenerations":null,"prompt":null,"parameters":{"created":1722433665,"usage":{"completion_tokens":171,"prompt_tokens":13,"total_tokens":184},"model":"gpt-35-turbo","system_fingerprint":null,"object":"chat.completion"}}