I am encountering an error as seen in the 1st image. The code is in the second image.
Please post code as text, not images.
It's a good idea to pay close attention to those underlined squiggles you see in Visual Studio Code, here on line 5. It's telling you, as is Salesforce DX, that your scratch definition is not valid JSON.
You have an extra layer of structure (curly brackets, defining a JSON object) around your
settings. Remove the outer level of braces and this should work.
Note that you don't have to turn on the
AuthorApex features in a Developer Edition org. They're already turned on.