También puedes preguntarle al ChatGPT
El código:
Código Delphi
[-]
uses
IdHTTP;
function SendRequest(const AInput: string): string;
var
HTTPClient: TIdHTTP;
Response: string;
begin
HTTPClient := TIdHTTP.Create(nil);
try
Response := HTTPClient.Post('https://api.openai.com/v1/engine/davinci-codex/completions', AInput);
finally
HTTPClient.Free;
end;
Result := Response;
end;